[whatwg] Indicate a file name for data: URLs?

Glenn Maynard glenn at zewt.org
Sat Apr 30 11:11:34 PDT 2011

On Sat, Apr 30, 2011 at 1:26 PM, Bjartur Thorlacius
<svartman95 at gmail.com> wrote:
> On 3/21/11, Philip Jägenstedt <philipj at opera.com> wrote:
>> On http://foolip.org/microdatajs/live/#json I have a "Download it!"
>> function which uses data: URLs to save JSON generated by JavaScript. The
>> only real limitation with this approach is that one cannot suggest a file
>> name, so in Opera the suggested file name is "default".
> Sorry for my naïvety, but does there need to be a suggested file name?

Yes.  A basic element of clicking a link to save it is giving a
reasonable default filename.

On systems where the file type is determined by the extension
(Windows), it's also critical that the browser know what a reasonable
default extension is, including for proprietary file types not known
to the browser.  It's no good to have to tell users "if you're in
Windows, be sure to save this file with the following extension, since
browsers give us no way of making this happen automatically".

Glenn Maynard

More information about the whatwg mailing list