Jump to content
Larry Ullman's Book Forums

Force Download


Recommended Posts

I was just wondering, does including a forced download link for PDFs in accompaniment to viewing the PDFs break the whole idea of serving PDFs through a proxy? I feel like it would. To be honest I'm not even sure that's necessary really, Most browsers seem to prompt you on whether you want to just open or save the PDF anyway. But I was curious, so thought I'd ask?

 

Thanks

 

Jonathon

Link to comment
Share on other sites

Well the example shows PDFs through the browser, but I wanted to put an option in that also allowed for a straight download of the PDF using something like

header ("Content-Type: application/pdf\n");
header ("Content-disposition: attachment; filename=\"$filename\"\n");
header ("Content-Length: $filesize\n");
readfile ($full_path_to_file . $filename);

As I said I don't think its much of an issue really, more curiosity really.

Link to comment
Share on other sites

I noticed the tip in the book and also in practice across chrome, opera, ff, safari and ie. I think only chrome actually opened it in the browser the rest opened it up in whatever pdf reader I have and some asked me whether or not I wanted to save it. I think I'm just going to keep it as it is. Thanks for the reply though.

Link to comment
Share on other sites

 Share

×
×
  • Create New...