March 12, 2010

Pages


Search Site


Subscribe

...to receive future posts via email.

Topics



Archives

File upload gotcha: PDFs get different mime types per browser

July 18 2008 by Adam

I've had some time over the last few days to start adding some of the "nice to have" features to a client site before delivering it, and one of those was the ability to upload product images and related PDFs, rather than having to teach them to always follow the naming scheme and how to use FTP. While testing my uploads in various browsers, I came across something I found to be very odd.

When you upload a PDF in IE, the file you receive has what I believe is the correct mime type: "application/pdf" however when you upload the same PDF file using the same code, in Firefox (tested in FF 2 and 3), the mime type is "application/download". I can't explain it. I have no idea why it's wrong. But it is, and consistently so. Could this be the one thing that is implemented correctly in IE and incorrectly in Firefox?

At any rate, it's a simple thing to accommodate. Note the accept attribute of the <CFFile> tag in the code sample below:

Posted in ColdFusion | 19 comments

Loading Tweetbacks...

19 comments:

Leave a Reply





Leave this field empty: