W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2013

Re: [whatwg] related subject -- access to local files RE: Forms: <input type=file> and directory tree picking

From: Glenn Maynard <glenn@zewt.org>
Date: Wed, 2 Oct 2013 17:51:29 -0500
Message-ID: <CABirCh9Ud2qmJ2fkz51j5sxCFTZEh+tB+cw5dwJiZBe7RP8LRw@mail.gmail.com>
To: David Dailey <ddailey@zoominternet.net>
Cc: WHAT Working Group <whatwg@lists.whatwg.org>
(Dropped CC's, since this isn't really related to the thread you're
replying to.)

On Wed, Oct 2, 2013 at 5:38 PM, David Dailey <ddailey@zoominternet.net>wrote:

> A few years ago, probably on www-html5, I remember posing a question about
> enabling the once-unbroken ability to allow JavaScript with user-consent,
> to
> insert an image file (as the src of an <img> into a web page, viewed in the
> browser).
>

You can access the File object of files selected with <input type=file>
(and similarly with drag-and-drop), create a URL representing it with
URL.createObjectURL, and use that with <img src>.

-- 
Glenn Maynard
Received on Wednesday, 2 October 2013 22:51:53 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:11 UTC