Jonathon Posted October 17, 2011 Share Posted October 17, 2011 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 More sharing options...
Larry Posted October 17, 2011 Share Posted October 17, 2011 I'm not exactly sure what you mean by a "forced download link for PDFs in accompaniment to viewing the PDFs". Link to comment Share on other sites More sharing options...
Jonathon Posted October 17, 2011 Author Share Posted October 17, 2011 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 More sharing options...
Larry Posted October 18, 2011 Share Posted October 18, 2011 I see. Different browsers will handle the content-disposition differently. In fact, the same browser will handle that differently based upon what kind of PDF support or plug-in exists. Link to comment Share on other sites More sharing options...
Jonathon Posted October 18, 2011 Author Share Posted October 18, 2011 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 More sharing options...
Recommended Posts