Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Content-disposition inline instead of attachment

$
0
0

Replies: 0

I would like to submit a new feature request to enhance the options for a particular download to allow the admin to specify whether they want the content disposition header to use “inline” instead of “attachment” so as to allow the browser to open the file in-browser (if the browser supports the type of the file).

The specific use-case I am interested in is allowing a PDF to be opened-up in-browser instead of always forcing the user to download the file. Our PDF will change over time and we don’t want to burden the users with continuously downloading copies of the file over and over if they just need to view a temporal version of it.

I have reviewed the plugin code and it seems that the post_meta information could be passed into the sdm_dispatch_file function and that function could review whether the download should use “inline” vs “attachment” in the content disposition header.

***Update*** I just realized that in addition to setting content-disposition to “inline”, I believe the “content-type” header will have to be modified to allow the file’s mime type to be returned to the browser so the browser knows what kind of file it is. This probably adds a lot more complexity than simply changing the header value from “attachment” to “inline” but it would be greatly appreciated!

I apologize if this is not the appropriate process for submitting feature requests — I could not find any documentation specifying the request process.

Thanks for your time!

  • This topic was modified 29 minutes ago by aceberle.
  • This topic was modified 19 minutes ago by aceberle.

Viewing all articles
Browse latest Browse all 59525

Trending Articles