blueimp/jQuery-File-Upload — Issue #847: Resume for chunked upload replaces file with remaining bytes
Author: marcfawzi
Created: 2011-12-06 12:16:43+00:00
State: open

Hi,

Context:

I forked this project with the hope of creating a specialized version focused mainly on XHR2 chunked (blobsliced) uploads including cross-domain capability. I need to properly implement or configure resume (not restart) on network or server error.

Environment:

I setup the project on my MacbookPro (running Apache) and I'm accessing it by its LAN IP address (not localhost) so that I can manually disconnect the network (turn off wifi) on my machine to test resuming uploads upon network error. I'm also simulating a real connection's latency/bandwidth on my laptop (via SpeedLimit app) I'm using Firefox 8 in my tests.

Question:

All seems to be working fine except the "resume" portion, which I need (for very large files a 'restart' from scratch upon network/server error is not acceptable)

I've plugged in the replacement to 'fail' handler in application.js (not sure if 'fail' is actually triggered upon network interruption and actual server errors or if it's only triggered upon encountering {fail: true} from the Ajax call, i.e. I'm asking if 'fail' is only called on application error or also on network/server error) << can you clarify?

I also setup multi-part to false and chunk size to 20000 (very low since I only have small image files < 500Kb to test with right now so I need this low value to see detailed chunk by chunk progress visually)

What happens when I turn off wifi then turn it back on is that the uploading does indeed seem to resume (the progress bar resumes its progress from where it stopped) but when it's done what I see is always a file less than 20000 bytes, sometimes 14.7k and other times 19.2k etc.... I suppose this is the last remaining chunk that is overwriting the uploaded file in php/files.

I set the 'discard_aborted_uploads' in index.php to false but that only has an effect on the regular case of chunked uploads, not when I cause a network interruption.

Thanks for your help.