Internet-Draft
draft-masinter-url-data-00.txt
February 2, 1996
Expires in 6 months


                       "Data: URL scheme"

Status of This Memo

     This document is an Internet-Draft.  Internet-Drafts are working
     documents of the Internet Engineering Task Force (IETF), its
     areas, and its working groups.  Note that other groups may also
     distribute working documents as Internet-Drafts.

     Internet-Drafts are draft documents valid for a maximum of six
     months and may be updated, replaced, or obsoleted by other
     documents at any time.  It is inappropriate to use Internet-
     Drafts as reference material or to cite them other than as
     ``work in progress.''

     To learn the current status of any Internet-Draft, please check
     the ``1id-abstracts.txt'' listing contained in the Internet-
     Drafts Shadow Directories on ftp.is.co.za (Africa),
     nic.nordu.net (Europe), munnari.oz.au (Pacific Rim),
     ds.internic.net (US East Coast), or ftp.isi.edu (US West Coast).

Abstract

A new URL scheme, "data:", is defined. It allows inclusion of small
data items as "immediate" data, as if it had been included externally.

Description

Some applications that use URLs also have a need to embed (small)
media type data directly inline. This proposal includes a new
URL scheme that would work like 'immediate addressing'. The format
of the URL is as follows:

        data:<mediatype>[;base64],<encoded-value>

where <mediatime> is a media type (with optional parameters, etc.).
The token "base64" means that the value is encoded as base64.
Otherwise, the value is encoded with the standard %xx URL encoding.

The mediatype, if left blank, defaults to text/plain;charset=US-ASCII.
As a shorthand, "text/plain" can be omitted but the charset parameter
supplied.

Examples:

This is only to be used for very short data types. For example,

      data:,A%20brief%20note

encodes the string "A brief note"

might be useful in a footnote link, while,

<IMG
SRC="data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw
AAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz
ByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp
a/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJl
ZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uis
F81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH
hhx4dbgYKAAA7"
ALT=Larry>

could be used for a small inline image in a HTML document.

This is only appropriate for delivery of very small inline data. The
embedded image above is probably near the limit of utility. For
anything else larger, or where the base64 encoding is problematic or
cumbersome, immediate data references within URLs are inappropriate.

History

This idea was originally proposed August 1995 by the author, and
recently revised because of the appearance of a (weaker) proposal in
a HTML INSERT proposal. This version allows eliding the media type,
packs the indication of the base64 encoding more tightly, and
eliminates the proposal to allow quoted printable, since the encoding
would not easily yield valid URLs without additional %xx encoding,
which itself is sufficient.

Security

Immediate data URLs introduce no new security considerations.

Author contact information:

Larry Masinter
Xerox Palo Alto Research Center
3333 Coyote Hill Road
Palo Alto, CA 94304
masinter@parc.xerox.com