Global Index
HTML5 JS API Index > File API Tutorials & Specs

FileWriter

Extends FileSaver.

This interface expands on the FileSaver interface to allow for multiple write actions, rather than just saving a single Blob.

Properties
unsigned long long
length
The length of the file. If the user does not have read access to the file, this must be the highest byte offset at which the user has written.
unsigned long long
position
The byte offset at which the next write to the file will occur. This must be no greater than length. A newly-created FileWriter must have position set to 0.
Operations
void
seek(long long offset)
Seek sets the file position at which the next write will occur.
void
truncate(unsigned long long size)
Changes the length of the file to that specified. If shortening the file, data beyond the new length must be discarded. If extending the file, the existing data must be zero-padded up to the new length.
void
write(Blob data)
Write the supplied data to the file at position. When the write method is called, user agents must run the steps below (unless otherwise indicated).
Referenced by
FileWriterCallbackhandleEvent(...)