One small nitpick: please please don't make all your files download with a single filename. In the article it gives an example of "fixing" a hideous generated filename like "203759-fs3.pdf" to download as "invoice.pdf". Yes this is a little nicer, but please be _even_ nicer and put other relevant info in the filename, "invoice-2013-01-01.pdf" is infinitely more useful to me. Context: My bank forces statement download…
Adding the business name in front of invoice-2013-... would be nice too.
“Right click and save as” needs to go away
61–70 of 194 posts
Re: “Right click and save as” needs to go away
#62There are already ways to force browsers to download using HTTP headers. The author says this is a "server-side solutions to front-end problem", okay. But anyways, when pages use this already, it OFTEN pisses me off, when I want to look at a PDF in browser, but the web app/page is forcing me to save it to disk and then re-open it in another app. What we _really_ need, that we _don't_ have a way to do right now -- is…
> when I want to look at a PDF in browser does that ever happen? > but the web app/page is forcing me to save it to disk and then re-open it in another app. because SumatraPDF actually loads faster than Adobe's browser plugin. Plus it's more secure, lacking all the weird scripting crud that shouldn't be in a document format anyway, smaller and open source. Only downside is that it can be really, really, really yellow…
Yeah, I've done it a few times. It's handy when I know I'm not going to save the PDF for any length of time. Using Foxit Reader helps with this since it's a lot lighter than anything from Adobe.
Re: “Right click and save as” needs to go away
#63I HATE sites that force downloading! I often have a 50+ MBit/sec connection and want to be able to choose between having a PDF (e.g. a invoice - all I need is the amount and the bank data) render in the browser so I can discard it after using (here: wiring the money) and not having to do: 1) download it 2) open it 3) do what I want to do 4) delete the file (which requires me to open the download folder, locate the fi…
Don't other browsers have a "temporary downloads" folder? For when you select "open this file with (...)" in the download dialog? Opera does. Now I finally sort of understand why people like opening PDFs in browser plugins, I suppose ... > I usually end up with a clusterfuck of a download directory (mine has 20 GB already in half a year, most of it is one-off downloads!) yeah well but that is your own fault for savin…
Re: “Right click and save as” needs to go away
#64I'd disagree with this being a "Front End" problem. You, serving the file, presumably have an idea what you want the user to do with the file. The .html page you propose editing is server side. The file being served is server side. The server configuration is server side. But most importantly, most browsers don't handle that attribute.
So I'd say what you want is the Content Disposition header, specifically, "Content Disposition: attachment". Set a header for the file type you want handled. But that's not enough on its own to cover most browsers in the wild.
Various browsers handle this header differently. Our CDN supports the following headers for files which are viewable directly in the browser. Using the appropriate header will prompt to Save As... even with a normal (left) click.
We recommend number 2 or number 8:
1. Content-Disposition: attachment
2. Content-Type: application/x-download
Content-Disposition: attachment
3. Content-Disposition: attachment
Content-Type: application/force-download
4. Pragma: no-cache
Expires: 0
Content-Type: application/force-download
Content-Transfer-Encoding: binary
5. Pragma: private
Cache-control: private, must-revalidate
Content-type: application/x-download
Content-Disposition: attachment
6. Content-Encoding: AuraganDownload
Content-Disposition: attachment
7. Pragma: public
Cache-Control: must-revalidate, post-check=0, pre-check=0
Content-Disposition: attachment
8. Content-type: application/octet-stream
Content-Disposition: attachment
This list was gradually added to over the last 10 years. Besides number 2, our main recommendation, the others here are for various edge cases such as popular downloaders or varieties of corporate firewalls, proxy servers, and reverse proxy (edge) caches. I included them just in case you're battling one of those cases and want some other incantations to try.Re: “Right click and save as” needs to go away
#65Re: “Right click and save as” needs to go away
#66Re: “Right click and save as” needs to go away
#67There are already ways to force browsers to download using HTTP headers. The author says this is a "server-side solutions to front-end problem", okay. But anyways, when pages use this already, it OFTEN pisses me off, when I want to look at a PDF in browser, but the web app/page is forcing me to save it to disk and then re-open it in another app. What we _really_ need, that we _don't_ have a way to do right now -- is…
I think Opera already does that.
Google's quick view has saved me many times. But there really should be one simple and good solution for this problem.
Re: “Right click and save as” needs to go away
#68Who was still using 'Right click and save as'?
Re: “Right click and save as” needs to go away
#69Re: “Right click and save as” needs to go away
#70Earlier quoted context omitted.
> when I want to look at a PDF in browser does that ever happen? > but the web app/page is forcing me to save it to disk and then re-open it in another app. because SumatraPDF actually loads faster than Adobe's browser plugin. Plus it's more secure, lacking all the weird scripting crud that shouldn't be in a document format anyway, smaller and open source. Only downside is that it can be really, really, really yellow…
>> when I want to look at a PDF in browser > does that ever happen? I do this all the time. I hate downloading crap that I'm probably just going to glance at once then discard.
And actually quite some other applications do this (open as a temporary file) as well, it's a very common pattern: 7-Zip, FileZilla, to name a few.
And even if you didn't, there's always a temp directory that gets cleaned next reboot. Though I agree, the browser should take care of this, like most apps.