blueimp/jQuery-File-Upload — Issue #711: Resume support is not working as it should
Author: hellais
Created: 2011-10-17 13:16:32+00:00
State: open

I am trying to get jQuery-File-Upload to work with resume support however I believe the functions using FileAPI and Blob are not seeking to the correct position in the file.

an example of what is happening.

In the first request we can see that the locally stored file has a size of 4504332, where the file that is supposed to be uploaded is 10104332.

INFO:Rocket.Requests:127.0.0.1 - "GET /globaleaks/submission/fileupload?file=abigfile.txt HTTP/1.1" - 200 202
filepath: //xxx//applications/globaleaks//uploads/abigfile.txt
append: True file.size: 10104332 getsize: 4504332

These are the following chunks that are of size 1000000:

INFO:Rocket.Requests:127.0.0.1 - "POST /globaleaks/submission/fileupload HTTP/1.1" - 200 224
filepath: //xxx//applications/globaleaks//uploads/abigfile.txt
append: True file.size: 10104332 getsize: 5504332

INFO:Rocket.Requests:127.0.0.1 - "POST /globaleaks/submission/fileupload HTTP/1.1" - 200 224
filepath: //xxx//applications/globaleaks//uploads/abigfile.txt
append: True file.size: 10104332 getsize: 6504332

INFO:Rocket.Requests:127.0.0.1 - "POST /globaleaks/submission/fileupload HTTP/1.1" - 200 224
filepath: //xxx//applications/globaleaks//uploads/abigfile.txt
append: True file.size: 10104332 getsize: 7504332

INFO:Rocket.Requests:127.0.0.1 - "POST /globaleaks/submission/fileupload HTTP/1.1" - 200 224
filepath: //xxx//applications/globaleaks//uploads/abigfile.txt
append: True file.size: 10104332 getsize: 8504332

INFO:Rocket.Requests:127.0.0.1 - "POST /globaleaks/submission/fileupload HTTP/1.1" - 200 224
filepath: //xxx//applications/globaleaks//uploads/abigfile.txt
append: True file.size: 10104332 getsize: 9504332

In this request however we see that the size of the file stored locally is more than the size of the file being uploaded.

INFO:Rocket.Requests:127.0.0.1 - "POST /globaleaks/submission/fileupload HTTP/1.1" - 200 225
filepath: //xxx//applications/globaleaks//uploads/abigfile.txt
append: False file.size: 10104332 getsize: 10504332

Also I did some checks at intermediate steps and I noticed that the even before completion when the file is resumed it does not match the original.

bla=204050;cat ~/Documents/abigfile.txt | head -n $bla | md5; cat abigfile.txt | head -n $bla | md5
726f25273d6d4ecb7f137eb59d1c9143
d5fc97458542eae12b5a6ed0d35bfc6c

Has the upload function been thoroughly tested?
Has someone actually used it?