ASPX templates
Version 5.x > ASPX templates > How can I prevent MIME type from being set to application/force-download? View modes: 
User avatar
Member
Member
dshannon-theatomgroup - 11/21/2012 9:06:54 AM
   
How can I prevent MIME type from being set to application/force-download?
I am working on a Kentico site. When retrieving a file using GetFile.aspx, on staging PDFs correctly have a inline disposition, and on production they incorrectly have a attachment disposition. (Open in browser on staging, as desired, and are saved to disk in production, the problem). Code files are identical, so it must be a configuration problem, presumably in IIS or Kentico.

I have tried providing a disposition parameter to GetFile.aspx, but this fails because the MIME type is application/force-download (only happens on prod). I am not sure where this MIME type is coming from. It doesn't show up in IIS' MIME types list. The PDFs in Kentico's database have the correct (application/pdf).

Whatever is different between production and staging I can't find. If anyone has any ideas of what it might be, I would appreciate the assistance.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/22/2012 1:10:34 AM
   
RE:How can I prevent MIME type from being set to application/force-download?
Hi,

Are the browser settings on both the same and is it always the same file? This also depends on the browser settings what is set to do with given file type - you can set it to always download, or always open or ask what to do.

Best regards,
Juraj Ondrus

User avatar
Member
Member
dshannon-theatomgroup - 11/27/2012 8:36:24 AM
   
RE:How can I prevent MIME type from being set to application/force-download?
This behavior is consistent across browsers and users, so it is not a browser setting. The server itself is serving it up as an application/force-download instead of application/pdf, so the browser doesn't have a chance to choose what to do. It occurs for multiple PDFs, it has not been tested with other file types.

Thank you,

-Drew

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/28/2012 1:46:36 AM
   
RE:How can I prevent MIME type from being set to application/force-download?
Hi Drew,

I am unable to reproduce the issue on my end. One of my browsers is set to download the PDFs and other to open them, bot are working correctly. Also, what are the differences between the two servers setup you have? Isn't it possible that it is set on the IIS level for given file extension?

Best regards,
Juraj Ondrus