Re: FAQ Topic - How do I prompt a "Save As" dialog for an accepted mime type? (2009-11-03)
- From: Thomas 'PointedEars' Lahn <PointedEars@xxxxxx>
- Date: Wed, 04 Nov 2009 18:34:08 +0100
Michael Haufe ("TNO") wrote:
Thomas 'PointedEars' Lahn wrote:
Michael Haufe ("TNO") wrote:
It is possible for browsers that support data urls.
Please enlighten us.
Example: http://thenewobjective.com/temp/save.html
If this FAQ Topic refers _only_ to prompting a dialog specifically per
mime-type on some white-list, then I apologize. Either way, I think
the method I've shown deserves a mention as an option.
Nice hack (and basically known to me), but you will observe two things:
1. The suggested download filename is anything but what would the --
unfortunately -- probably most widely distributed OS, Microsoft Windows,
recognize as an image (or whatever). This would be important, because
especially Windows browsers are then not able to provide a list of
alternative "file types" of the same type class in the "Save As" dialog
(say, you Save-As a JPEG image and be presented with choices from .bmp
to .png, depending on the image filters that are installed.) And I think
mentioning the `Content-Disposition' header was a hint as to that.
2. You, like James T. Kirk, have not solved the scenario but changed the
conditions of the test :) The effective MIME media type is no longer an
accepted one (any other fantasy type will do as well) to prompt the "Save
As" dialog. So you get a commendation for original thinking ;-)
IMHO, the problem that speaks from the question is a problem with no
solution without additional APIs because resources declared as one of the
accepted MIME types (as in the Accept HTTP header) are usually downloaded
to the cache and (dis)played, not presented for download as a file by
default.
Insofar the given answer ("It is not possible with client-side javascript.")
is imprecise, indeed.
About whether your hack should enter the FAQ, because of the above I am
inclined to say no, but it is not for me to decide.
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
.
- References:
- FAQ Topic - How do I prompt a "Save As" dialog for an accepted mime type? (2009-11-03)
- From: FAQ server
- Re: FAQ Topic - How do I prompt a "Save As" dialog for an accepted mime type? (2009-11-03)
- From: Michael Haufe (\"TNO\")
- Re: FAQ Topic - How do I prompt a "Save As" dialog for an accepted mime type? (2009-11-03)
- From: Thomas 'PointedEars' Lahn
- Re: FAQ Topic - How do I prompt a "Save As" dialog for an accepted mime type? (2009-11-03)
- From: Michael Haufe (\"TNO\")
- FAQ Topic - How do I prompt a "Save As" dialog for an accepted mime type? (2009-11-03)
- Prev by Date: Re: FAQ Topic - How do I change the confirm box to say yes/no or default to cancel? (2009-11-02)
- Next by Date: ♣(=@ω@=)♣cheap *** pants belts bikinis underwear at www.ecyaya.com
- Previous by thread: Re: FAQ Topic - How do I prompt a "Save As" dialog for an accepted mime type? (2009-11-03)
- Next by thread: Errors in Javascript?
- Index(es):