input[type=file] element. By using
File API, web developers can access local files on the client machine in a secure way without the need for extensions or plugins.
File API allows a browser or app to read and manipulate files but only if the user provides permission to do so. Additionally, the File API allows for smoother file upload experiences without plugins.
Multiple file uploads (4 GB per file) with file type filtering is also supported. In the following example, multiple GIF or JPEG files can be selected by the user:
<input type="file" name="pic" multiple accept="image/gif, image/jpeg" />
For more information, see the File Upload state (type=file) section within the HTML5 spec.
File API Example
The following code example acquires basic file-related information such as name, type, and size.
Check out the Blob Dev Guide entry for more details.
FileReader object lets you asynchronously read individual
Blob objects by firing progress events as the read occurs to event handler methods attached to the
FileReader object. Because of the asynchronous reading, it is possible to catch errors, know when a load is complete, and monitor the read progress.
For more details check out the FileReader Dev Guide entry!
MSStream object is a Document Object Model (DOM) type that represents a stream of unsized, sequential binary data. You use the
MSStream object for data that is streaming over the network which hasn't completed downloaded yet, or as an analogous type to
IInputStream WinRT objects.
MSStream is backed by
When you get
MSStream from HTML5 API (like an
XmlHttpRequest with a
responseType of “
ms-stream”, as you’d use when downloading a file or video), you can pass those results to various WinRT APIs that accept
IRandomAccessStream as input.