LoginSignup
9
9

More than 5 years have passed since last update.

File API で大きなファイルをアップロードするなら、Blob を slice する。

Last updated at Posted at 2012-03-16

File API
W3C Working Draft 20 October 2011

interface FileReader: EventTarget {

  // async read methods
  void readAsArrayBuffer(Blob blob);
  void readAsBinaryString(Blob blob);
  void readAsText(Blob blob, optional DOMString encoding);
  void readAsDataURL(Blob blob);

  ...
}

interface Blob {

  readonly attribute unsigned long long size;
  readonly attribute DOMString type;

  //slice Blob into byte-ranged chunks

  Blob slice(optional long long start,
             optional long long end,
             optional DOMString contentType); 

};
9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9