Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
The BlobBuilder
interface provides an easy way to construct Blob
objects. Just create a BlobBuilder
and append chunks of data to it by calling the append()
method. When you're done building your blob, call getBlob()
to retrieve a Blob
containing the data you sent into the blob builder.
BlobBuilder
interface has been deprecated in favor of the newly introduced Blob
constructor.void append(in ArrayBuffer data); |
void append(in Blob data); |
void append(in String data, [optional] in String endings); |
Blob getBlob([optional] in DOMString contentType); |
File getFile(in DOMString name, [optional] in DOMString contentType); |
Appends the contents of the specified JavaScript object to the Blob
being built. If the value you specify isn't a Blob
, ArrayBuffer
, or String
, the value is coerced to a string before being appended to the blob.
void append( in ArrayBuffer data ); void append( in Blob data ); void append( in String data, [optional] in String endings );
data
Blob
being constructed.endings
\n
are to be written out. This can be "transparent"
(endings unchanged) or "native"
(endings changed to match host OS filesystem convention). The default value is "transparent"
.Returns the Blob
object that has been constructed using the data passed through calls to append()
.
Blob getBlob(
in DOMString contentType Optional
);
Blob
. This will be the value of the Blob
object's type property.A Blob
object containing all of the data passed to any calls to append()
made since the BlobBuilder
was created. This also resets the BlobBuilder
so that the next call to append()
is starting a new, empty blob.
Returns a File
object.
File getFile( in DOMString name, [optional] in DOMString contentType );
File
. This will be the value of the File
object's type property.A File
object.
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 8
|
Yes | ? — 18
|
10
|
No | No |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | 3
|
? | Yes | ? — 18
|
No | No | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/BlobBuilder