[whatwg] data: scheme in form submission

On Sat, 15 Jan 2005, Olav Junker Kj?r wrote:
>
> The spec just describes how escape and embed the dataset in the URI, and 
> then it says: "Then, access the resulting URI". But what does it mean to 
> access a data URI?

Same as accessing an HTTP URI. You dereference it and read the document. 
There's nothing special about data: URIs per se.


> However, by describing specific rules for how to handle data-URI, the 
> spec gives the impression that this scheme is somehow a useful feature. 
> If I understand you correctly, you are saying that the data-scheme is 
> not really useful as an action target, and that its only described in 
> the spec for completeness? In that case, there are many other schemes 
> <http://www.iana.org/assignments/uri-schemes> that authors could 
> theoretically use in an action-attribute.

I've attempted to address all the ones that (a) I know enough about to 
make some sort of attempt, and (b) browsers support.

I'm happy to define the others too if people can provide details on how 
they should work for form submission.

Note that the data: URI scheme's definition is actually very useful for 
debugging. It lets you see what the UA wants to send without having to use 
a server side echo script, just by doing:

   action="data,%%" method="post"

...and you can create a simple file-to-data: convertor using just:

   action="data:," method="put"

...and a single file upload field.


> Maybe the spec could just say that the form throws a 
> URI_SCHEME_NOT_SUPPORTED exception when an unsupported scheme is used.

You can't really throw an exception, since scripting need not be involved. 
But you could (and would) throw an exception if the browser doesn't know 
the scheme -- the point is browsers typically _do_ know data:.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Friday, 21 January 2005 03:28:24 UTC