This page is Not Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

readAsBlob

Summary

Performs an asynchronous read of an MSStream object in order to create a Blob object.

Method of apis/file/MSStreamReaderapis/file/MSStreamReader

Syntax

 MSStreamReader.readAsBlob(/* see parameter list */);

Parameters

stream

Data-type
Blob

The MSStream object to read.

maxSize

Data-type
Number

(Optional)

String that specifies the maximum size of the object to read.

Return Value

No return value

Notes

The readAsBlob method is used by msStreamReader to create a Blob object from an MSStream. When the read begins, the readyState property is set to the LOADING state on MSStreamReader and the onloadstart event is fired. Progress for the read is monitored by the onprogress event. When the read completes, the onloadend event fires and readyState is set to DONE and MSStreamReader.result returns the new Blob object. A read operation can be interrupted if an error occurs or the abort method is run. If an error occurs, the onloadend event sets the readyState to DONE, and passes the error using the error property.

Attributions