mime-types

setting content type in java for file download

Hi... In my application i like to provide file download facility. I set the file types to response.setContentType. How can I set the content types for almost all known file types? Is there any easy way? or I need to set it manually like i do now, which is given below. if (pictureName.indexOf("jpg") > 0) { re...

Download .xlsx file using Response.TransmitFile()

I'm working on some code that generates an Excel spreadsheet server-side and then downloads it to the user. I'm using ExcelPackage to generate the file. The generation is working just fine. I can open the generated files using Excel 2007 with no issues. But, I'm having trouble downloading the file with Response.TransmitFile(). Right...

How can I change a type in a SVN repository?

How can I change the type of all the files in a repository SVN who have the extension xml from the binary type to text. I do not want to change the type of one file only but all files with extension .xml ...

Passing data around with QMimeData in Qt drag and drop

I'm trying to understand how data gets passed around when using drag and drop in Qt. From what I understood from the examples I've been studying, you first define a widget as draggable by overriding methods inherited through QWidget. In the implementation of the overridden method, the examples I've been looking at instantiate a pointer ...

Headers and MIME types for HTML email messages (sending through PHP)

What is the correct header information and MIME types for an email message with HTML content only, not mixed type (with both text and HTML). Just to inform, I am using Swiftmailer (PHP) to this job. ...

Response Content Types

What are the response content types for .docx, .xlsx, .pptx, .zip etc. ? Can you give me a list of all content types ? ...

IE and Content-disposition inline vs. extension-token [unanswered]

This question, despite accepted-answer, was not answered. The reason it has an answer marked as accepted is because the bounty system, which I used, demands one. You are still welcome to answer this question if you know the answer (please do) - I will try to reputation-pay you in upvotes elsewhere. (Reputation purists may now throw rocks...

File upload has a MIME type of "application/x2x-download" - what the hell is that?

My Rails site allows users to upload documents, I am using the attachment_fu plugin. I have a list of allowed [MIME] content types that I allow - the standard image formats, Office documents, PDF, etc. I have a user who cannot upload any PDF documents because the validation fails, looking in the logs attachment_fu thinks the MIME type is...

file->getMimeType() always returns application/octet-stream with Zend Framework

hi people, my file form element is very simple: $this->archivo = new Zend_Form_Element_File('archivo'); $this->archivo->setLabel('Archivo:') ->setRequired(true) ->setDestination(UPLOAD_PATH) ->addValidator('Count', false, 1) ->addValidator('Size', false, MAX_FILE_SIZE) ->addValidator('Extension', ...

Rails: MIME type issues with .m4v files

In my Rails app I'm trying to get the MIME type of a file like so: MIME::Types.type_for("example.m4v").to_s But it's not recognizing it. I tried adding the following to config/initializers/mime_types.rb (and restarted the server) without any luck: Mime::Type.register "video/mp4", :m4v ...

Asp.Net MVC2 RenderAction changes page mime type?

It appears that calling Html.RenderAction in Asp.Net MVC2 apps can alter the mime type of the page if the child action's type is different than the parent action's. The code below (testing in MVC2 RTM), which seems sensible to me, will return a result of type application/json when calling Home/Index. Instead of dispylaying the page, the...

Determining a Local File's Mime Type (Content-type) With PHP

I am trying to determine a file's mime type. I've tried a few methods, but haven't come up with anything that gives consistent output. I've tried $mime = mime_content_type($file) and $mime = exec('file -bi ' . $file). I am serving up images, CSS, and JavaScript. Example mime_content_type() output: jquery.min.js - text/plain editor....

ASP.NET Create zip file for download: the compressed zipped folder is invalid or corrupted

string fileName = "test.zip"; string path = "c:\\temp\\"; string fullPath = path + fileName; FileInfo file = new FileInfo(fullPath); Response.Clear(); Response.ClearContent(); Response.ClearHeaders(); Response.Buffer = true; Response.AppendHeader("content-dispositio...

even PHP has 'bugs' with IE

This is not a real bug BUT for sure it is not what you would expect. I have this sample code to upload images: if($type=="image/jpg" || $type=="image/jpeg" || $type=="image/pjpeg" || $type=="image/tiff" || $type=="image/gif" || $type=="image/png") { // make upload else echo "Incorrect format ...."; The problem is that if I modify...

Why would certain browsers request all pages on my ASP.Net Web site twice?

Firefox is issuing duplicate requests to my ASP.Net web site. It will request a page, get the response, then immediately issue the same request again (well, almost the same -- see below). This happens on every page of this particular Web site (but not any others). IE does not do this, but Chrome also does this. I have confirmed that the...

Does Chrome always adds an XLS extension on a vnd.ms-excel mime type?

It seems that a simple download of a PHP generated CSV file (with a vnd.ms-excel mime type for the sake of opening it with (Open)Office readly upon the "Save as..." dialog, when present) always gets the unwanted .xls extension when the UA is Google Chrome. The file would then be named as myfile.csv.xls. Firefox behaves correctly. I wonde...

Finding a MIME type for a file on windows

Is there a way to get a file's MIME type using some system call on Windows? I'm writing an IIS extension in C++, so it must be callable from C++, and I do have access to IIS if there is some functionality exposed. Obviously, IIS itself must be able to do this, but my googling has been unable to find out how. I did find this .net relat...

Download office document without the web server trying to render it

I'm trying to download an InfoPath template that's hosted on SharePoint. If I hit the url in internet explorer it asks me where to save it and I get the correct file on my disk. If I try to do this programmatically with WebClient or HttpWebRequest then I get HTML back instead. How can I make my request so that the web server returns th...

How does SimpleWorkerRequest associate MIME types with extensions?

I was serving html referencing svg files in Cassini, and having problems since the mime type was not being sent properly. I ended up writing my own port of Cassini that set the extension based on mime type. After a good night of sleep I realized that there might be some sort of registry key or config file where I can configure custom mi...

QFileDialog filter from mime-types

I want the filter in a QFileDialog to match all audio file types supported by Phonon on the platform in question. 1 - However I am not able to find a way in Qt to use mime types in a filter. How can I do that? 2 - Or how can I find the corresponding file extensions for the mimetypes manually? The solution should be Qt based, or at leas...