   @returns {undefined}
   ###
   download: if Meteor.isServer then (http, version = 'original') ->
-    console.info "Meteor.Files Debugger: [download(#{http.request.originalUrl}, #{version})]" if @debug
+    console.info "[Meteor.Files] [download(#{http.request.originalUrl}, #{version})]" if @debug
     responseType = '200'
     if not @public
       if @currentFile

    check @debug, Boolean
    check @schema, Object
    check @public, Boolean
    check @strict, Boolean
    check @throttle, Match.OneOf false, Number
    check @protected, Match.OneOf Boolean, Function
    check @chunkSize, Number
    check @permissions, Number
    check @storagePath, String
    check @downloadRoute, String
    check @integrityCheck, Boolean
    check @collectionName, String
    check @namingFunction, Function
    check @onBeforeUpload, Match.OneOf Boolean, Function
    check @allowClientCode, Boolean
    check @downloadCallback, Match.OneOf Boolean, Function
    check @onbeforeunloadMessage, Match.OneOf String, Function

    if @public and @protected
      throw new Meteor.Error 500, "[Meteor.File.#{@collectionName}]: Files can not be public and protected at the same time!"
    
    @cursor        = null
    @search        = {}
    @collection    = new Mongo.Collection @collectionName
    @currentFile   = null
    @storagePath   = @storagePath.replace /\/$/, ''
    @downloadRoute = @downloadRoute.replace /\/$/, ''

    @collection.attachSchema @schema
    @collection.deny


        currentChunk = 0
        sentChunks   = 0
        EOFsent      = false
        transferTime = 0

        calculateStats = _.throttle ->
          _t = (transferTime / sentChunks) / config.streams
          result.estimateTime.set (_t * (fileLength - sentChunks))
          result.estimateSpeed.set (config.chunkSize / (_t / 1000))
          progress = Math.round((sentChunks / fileLength) * 100)
          result.progress.set progress
          config.onProgress and config.onProgress.call result, progress
          return
        , 250

        sendViaDDP = (evt) -> Meteor.defer ->
          console.timeEnd('loadFile') if self.debug
          opts =
            meta: config.meta
            file: fileData
            fileId: fileId
            binData: evt.data.bin
            chunkId: evt.data.chunkId
            fileLength: fileLength
            eof: false

          if opts.binData and opts.binData.length
            Meteor.call self.methodNames.MeteorFileWrite, opts, (error) ->
              ++sentChunks
              transferTime += (+new Date) - evt.data.start
              if error
                end error
              else
                if sentChunks >= fileLength
                  sendEOF opts
                else if currentChunk < fileLength
                  upload()
                calculateStats()
              return
          else
            sendEOF opts
          return

        sendEOF = (opts) -> Meteor.defer ->
          unless EOFsent
            EOFsent = true
            opts =
              meta: config.meta
              file: fileData
              fileId: fileId
              binData: 'EOF'
              chunkId: -1
              fileLength: fileLength
              eof: true
            Meteor.call self.methodNames.MeteorFileWrite, opts, end
          return

        if worker
          worker.onmessage = sendViaDDP
          worker.onerror   = (e) -> 
            end e.message
            return

        if self.debug
          if worker
            console.info "[Meteor.Files] [insert] using WebWorkers"
          else
            console.info "[Meteor.Files] [insert] using MainThread"

        upload = -> Meteor.defer ->
          start = +new Date
          if result.onPause.get()
            result.continueFunc = -> createStreams()
            return

          ++currentChunk
          if worker
            worker.postMessage({sentChunks, start, currentChunk, chunkSize: config.chunkSize, file: config.file})
          else
            ((chunkId) ->
              fileReader = new FileReader
              chunk = config.file.slice (config.chunkSize * (chunkId - 1)), (config.chunkSize * chunkId)
              readHandler = (evt) ->
                sendViaDDP data: 
                  bin: (fileReader?.result or evt.srcElement?.result or evt.target?.result).split(',')[1]
                  chunkId: chunkId
                  start: start
                return

              fileReader.onloadend = readHandler
              fileReader.onerror = (e) ->
                result.abort()
                onError and onError.call result, (e.target or e.srcElement).error, fileData
                return

              fileReader.readAsDataURL chunk
              return
            )(currentChunk)
          return

        createStreams = ->
          i = 1
          while i <= config.streams
            upload()
            i++
          return

        prepare = ->
          if config.chunkSize is 'dynamic'
            if config.file.size >= 104857600
              config.chunkSize = 1048576
            else if config.file.size >= 52428800
              config.chunkSize = 524288
            else
              config.chunkSize = 262144
          
          _len = Math.ceil(config.file.size / config.chunkSize)
          if config.streams is 'dynamic'
            config.streams = _.clone _len
            config.streams = 32 if config.streams > 32

          fileLength     = if _len <= 0 then 1 else _len
          config.streams = fileLength if config.streams > fileLength
          console.log {config, fileLength}
          createStreams()
          return
        prepare()
        return result
      else
        console.warn "[Meteor.Files] [insert] Have you forget to pass a File itself?"
  else
    undefined

