code: function(peer, data, chunkIdx, fileObj, isLastChunk, updateProgress, emit){
    if (fileObj.fileWriter) { // todo, when the whole file is done writing, remove this fileWriter on fileObj(in tasks)
      doWriting(fileObj.fileWriter, fileObj, peer, chunkIdx, data, isLastChunk, updateProgress, emit);
    } else {
      fs(fileObj).then(fileExists).then(getFile).then(getFileWriter).then(function(writer) {
        doWriting(writer, fileObj, peer, chunkIdx, data, isLastChunk, updateProgress, emit);
      }, function(err) {
        emit('error/file', new FilerError({
          name: 'ChromeFileSystemError', code: "ERR_CHROME_FILESYSTEM_ERROR",  message: err.message || 'failed to get FileSystem Writer',
          peerID: peer._peerID, fileID: fileObj.fileID
        }));
        fileObj.fileWriter = null;
      });
    }
  }
docs: ------------------- Chrome Filesystem writing utilities