ebidel / idb.filesystem.js

HTML5 Filesystem API polyfill using IndexedDB
https://www.npmjs.com/package/idb.filesystem.js
Other
488 stars 46 forks source link

File writer callbacks do not match spec. #23

Open ncbray opened 11 years ago

ncbray commented 11 years ago

Currently the FileWriter calls onwriteend on success, and onerror on failure.

It should call onwrite on success, onerror on failiure, and then onwriteend in both cases.

thosaka commented 11 years ago

Hi ncbray and Eric, I tested this library with simple FileSystem Writer API sample and most of functions were just working great on both FireFox and google chrome. but i also found both onwritestart and onwriteend should return ProgressEvent which contain fileWriter as target. below is the one chrome returned when it fire onwriteend callback.

fileWriter.onwriteend = function(e) { ... }

e: ProgressEvent
    target: FileWriter
    type: "writeend"
    lengthComputable: true
    loaded: 50
    total: 50
    ...