_Original author: [email protected] (November 05, 2010 17:26:36)_
Use Content-Disposition to force a Save As behavior in the browser.
_Original issue: http://code.google.com/p/google-refine/issues/detail?id=181_
@weblate : do we still have this situation? We seem to support that, but I might not understand well.
Regards, Antoine
I think most exporters comply with this, yes, but I would not swear all of them do. We could decide to close this on the basis that it is not specific enough.
David (ie [email protected]) was the original author of the Google Refine, so it'd be nice to be able to say the bug was actually fixed rather than arbitrarily closing his bug report. I'm not seeing any mentions of Content-Disposition in the code. Is this buried in a library somewhere?
Specifically, we should use a form like:
Content-Disposition: attachment; filename="EURO rates"; filename*=utf-8''%e2%82%ac%20rates
if the filename contains non-ASCII characters, otherwise just:
Content-Disposition: attachment; filename="EURO rates"
David (ie [email protected]) was the original author of the Google Refine, so it'd be nice to be able to say the bug was actually fixed rather than arbitrarily closing his bug report.
@tfmorris: thank you for taking the time to answer. Yes, I have much respect for the originals contributors of OR, and as such, going thru the old issues and making sure that we follow them to completion seams to me to be one way of honoring their work.
I understand this issues is about pretty much all exporters.
Now, is this issue (and the Content-Disposition) about getting strait to the « Save file » dialog, instead of opening an empty tab and then AFTER, triggering the « Save file » dialog? Is it about removing this extra step? Because the way this issue is written, someone could this that certain exporters show a page of result, and that the user has to, himself, choose « Save as… » in the menu, which is not something I recall seeing anywhere.
Regards, Antoine
@antoine2711 I totally appreciate the effort to clean up and triage old issues! I was just disagreeing with @wetneb's suggestion that we close it as not specific enough.
Without Content-Disposition: attachment the browser will guess what to do with the file based on its extension or media type and may open a new tab, send it to an app, or just save it to a file. The goal is to force it to always be saved to a file.
To be clear, I haven't gone through and verified all of the exporters, so perhaps they all do the right thing, but I think we should check before closing the issue.
This was fixed in https://github.com/OpenRefine/OpenRefine/pull/2722/commits/a409c42d22c940bd065ae70fbe863f553cdcd19f which was part of #2722 - and we beat the 10 year deadline on @dfhuynh's request :)
For exporters that have a Preview mode, that parameter controls this behavior.