I am trying to open a PPT file. I don't want to show the Save As dialog. I instead just want to open the file immediately on click. How can this be done?
views:
42answers:
2You need to take two things into account:
The HTTP
Content-Disposition
header -if any- should be set toinline
, notattachment
. The later will indeed force the client to display a Save As dialogue.The HTTP
Content-Type
header should contain a mime type which is recognized by the client as being a PPT file which is usuallyapplication/vnd.ms-powerpoint
. When usinginline
and the browser really don't know what to do with it (i.e. there is no application associated with the content type or extension according to the underlying platform/OS), then it will open the Save As regardless.
You can debug the response headers using tools like Firebug. You can modify response headers in server side code and/or webserver configuration. If you tell which language and/or webserver you're using, then we may be able to give more specific solutions.
This is a browser setting. You can try to force a save dialog with Content-disposition
, but not vice-versa. I don't think there's much you can except tell your users to choose to "Always open files of this type".