CFFILE upload gotcha with IE and JPG
Short little reminder for myself. For some reason IE sets the content type of a JPG file to image.pjpeg when uploading a JPG file. So make sure to update your cffile upload to accept this file along with image/jpg and image/jpeg. This doesn’t happen in FireFox. The full accept string for JPGs should be: image/jpg,image/jpeg,image/pjpeg.
Thanks for the tip — will implement into our applications.
pjpeg == progressive jpeg
Any ideas on how to get IE to pass a jpg to the program configured to display a jpg based on file extension instead of always showing them in the browser when I stream a file out using
When I send it as an attachment, it will open in the correct program, but will ask the open or save question.
I also notice that when I send it as an attachment, the open/save dialog says it is an unknown file type.
Sorry, it stripped the tags I sent, the code was without the tags.
cfheader name=”Content-Disposition” value = “inline;filename=thefile.jpg”
cfcontent type=”image/jpg” variable=”imageBinary”
@Kevin
Don’t really know, but try this:
<cfheader name=”Content-Disposition” value=”attachment;filename=memberlist.xls”>
<cfcontent type=”application/octet-stream” file=”#FullFileName#” deletefile=”true” reset=”true”>
I use this so that the browser will prompt them for a program to use to open the file. Notice the application/octet-stream, which is generic.
We use the attachment method when we are launching one file at a time and that works fine, but we have a page that allows them to select a bunch of images to download to image pro and it gets pretty annoying to get all the open/save dialogs. The problem isn’t just within coldfusion, if I do a simple window.open in javascript, it too goes to the browser instead of to the program based on the file extension. Yet, it works fine for .tif files.