         check currentChunk, Number
         check randFileName, String
 
-        console.info 'Receive chunk #' + currentChunk + ' of ' + chunksQty + ' chunks, file: ' + fileData.name or fileData.fileName if self.debug
+        console.info "Received chunk ##{currentChunk} of #{chunksQty} chunks, in part: #{part}, file: #{fileData.name or fileData.fileName}" if self.debug
 
         i = 0
         binary = ''
+        # console.log file.byteLength
         while i < file.byteLength
           binary += String.fromCharCode(file.buffer[i])
           i++
 
+        last = (chunksQty * partsQty <= totalSentChunks)
+        # console.log "LAST", last, chunksQty * partsQty, totalSentChunks
+
         cleanName = (str) ->
           str.replace(/\.\./g, '').replace /\//g, ''
 
         fileName  = cleanName(fileData.name or fileData.fileName)
         ext       = fileName.split('.').pop()
+        pathName  = "#{self.storagePath}/#{randFileName}"
+        pathPart  = "#{self.storagePath}/#{randFileName}_#{part}.#{ext}"
         path      = "#{self.storagePath}/#{randFileName}.#{ext}"
         result    = 
           name:       fileName

      onUploaded and onUploaded.call self, error, data

    if onBeforeUpload
      if not onBeforeUpload.call file, fileReader
        end new Meteor.Error(500, "FORBIDDEN"), null
        return false

    fileReader.onload = (chunk) ->
      onProgress and onProgress((currentChunk / chunksQty) * 100)

      binary      = chunk.srcElement or chunk.target
      arrayBuffer = new Uint8Array binary.result

      if chunksQty is 1
        Meteor.call self.methodNames.MeteorFileWrite, arrayBuffer, fileData, meta, first, chunksQty, currentChunk, randFileName, (error, data) ->
          end error, data
      else
        Meteor.call self.methodNames.MeteorFileWrite, arrayBuffer, fileData, meta, first, chunksQty, currentChunk, randFileName, (error, data)->
          if data.chunk <= chunksQty
            currentChunk = data.chunk + 1
            from         = currentChunk * self.chunkSize
            to           = from + self.chunkSize
            fileReader.readAsArrayBuffer file.slice from, to
          else
            end error, data
      first = false



    if chunksQty is 1
      fileReader.readAsArrayBuffer file
    else
      fileReader.readAsArrayBuffer file.slice 0, @chunkSize
    
    return fileReader

  ###
  @isomorphic

          type:       fileData.type
          size:       fileData.size
          chunk:      currentChunk
          last:       last
          isVideo:    fileData.type.toLowerCase().indexOf("video") > -1
          isAudio:    fileData.type.toLowerCase().indexOf("audio") > -1
          isImage:    fileData.type.toLowerCase().indexOf("image") > -1
