{{non-standard_header}}
Summary
The FileHandle
interface provides access in read or write mode to a file, dealing with all the necessary locks.
As FileHandle
objects are bound to a fake file system built on top of IndexedDB, such an object is created using the {{domxref("IDBDatabase.mozCreateFileHandle")}} method.
Properties
- {{domxref("FileHandle.name")}} {{readonlyinline}}
- The name of the handled file.
- {{domxref("FileHandle.type")}} {{readonlyinline}}
- The mime type of the handled file.
Events Handler
- {{domxref("FileHandle.onabort")}}
- The {{event("abort")}} event is triggered each time the handled file is aborted.
- {{domxref("FileHandle.onerror")}}
- The {{event("error")}} event is triggered each time something goes wrong.
Methods
- {{domxref("FileHandle.open()")}}
- Returns a {{domxref("LockedFile")}} object to read or write the associated file safely.
- {{domxref("FileHandle.getFile()")}}
- Returns a {{domxref("DOMRequest")}} object. In case of success, the request's result is a {{domxref("File")}} object representing a snapshot of the handled file.
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('FileSystem')}} | {{Spec2('FileSystem')}} | Draft proposal. |
See also
- {{domxref("LockedFile")}}
- {{domxref("File")}}