 @onmessage = (e) ->
     file = e.data.file
     url = e.data.url
+    method = e.data.method or 'POST'
     name = e.data.name
     blobs = []
     bytes_per_chunk = 1024 * 1024 * 10 # 10MB

        end = start + bytes_per_chunk

    for blob, i in blobs
        response = uploadChunk(blob, url, name, i, blobs.length)
        data =
            message: 'progress'
            body: ((i + 1) * 100 / blobs.length).toFixed(0)

uploadChunk = (blob, url, method, filename, chunk, chunks) ->
    xhr = new XMLHttpRequest
    xhr.open method, url, false
    xhr.onerror = -> throw new Error 'error while uploading'
    formData = new FormData
    formData.append 'name', filename
