Blob()
생성자는 새로운 Blob
객체를 반환합니다. 해당 블롭의 콘텐츠는 매개변수로 제공한 배열을 이어붙인 값입니다.
Syntax
var aBlob = new Blob( array[, options]);
매개변수
- array는
ArrayBuffer
,ArrayBufferView
,Blob
,DOMString
객체 또는Blob
안에 들어갈 이러한 객체가 혼합되어 있다. DOMString은 UTF-8로 인코딩 된다. - options는 다음 두 속성을 선택적으로 사용할 수 있는
BlobPropertyBag
dictionary이다.type
, (기본값""
) blob에 넣을 배열 내용의 MIME 형식을 나타낸다.endings
, (기본값"transparent"
) 줄 끝 문자 \ n을 포함하는 문자열을 어떻게 써야 하는지를 지정. 다음 두 값을 사용 :"native"
는 호스트 OS 파일 시스템 규칙과 일치하도록 줄 끝 문자가 변경된다는 것을 의미합니다. 즉,"transparent"
는 끝이 변경없이 blob에 저장됨을 의미합니다.
예제
var aFileParts = ['<a id="a"><b id="b">hey!</b></a>']; // an array consisting of a single DOMString
var oMyBlob = new Blob(aFileParts, {type : 'text/html'}); // the blob
명세서
명세서 | 상태 | 비고 |
---|---|---|
File API The definition of 'Blob()' in that specification. |
Working Draft | 기초정의(Initial definition) |
브라우저 호환성
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.