retry

Fiver's picture

Hello everyone,

i have recently created a web app where users can upload and crop images. The original version was made on the 1.0.2 version witch worked great exempt for some minor details like the zero file size.
Just a few weeks ago I upgraded the swfupload to the latest release 2.0.2 and I must say it's pretty impressive, but... there is one thing that really goes on my nerves.

When the user gets disconnected in the middle of the upload all of the images get canceled, swfupload 1.0.2 used to wait for the user to click ok and then it canceled the second image if the connection was still down.
This was great because, if the user reestablished the connection without clicking ok the rest of the images resumed uploading.

Is this still achievable or do I have to downgrade to the 1.0.2 to get this result?

The relevance of this is there because of the ADSL policy for dynamic IPs.
Users get disconnected every 24h for the ip to changed. This can be very unpleasant because my users usually leave the upload over night, and get a shock when they wake up and see that half of the images were canceled because of the reconnect....

It would be great if there would be a retry option or at least the wait option re enabled.

EDIT: ok never mind on the wait thing, I figured that one out, I just added the alert to the error translation and it solved the problem.

case SWFUpload.UPLOAD_ERROR.IO_ERROR:
translated_error_code = -30;
alert("woot");
break;

but the retry would still be awesome.

gyphie's picture

Retry

I'll add "retry" to the todo list and hopefully it will be released in v2.1.0

No ETA for that.

Fiver's picture

Retry

I've added retry to the 2.0.2 version of SWFUpload, if anyone is interested in the code or the compiled file + js files just PM me or ask me in the thread Eye-wink

it's a quick fix that replaces the IO error default action of UploadComplete() with the new retry function. The retry limit can be set just like the file upload limit.

allowed_filesize : 5120, // 5 MB
allowed_retrys : 15,
retry_timeout : 4000, //4 seconds

ignore the typo Sticking out tongue I'm to lazy to fix this.

EDIT: also added the retry timeout. To retry to infinite just set
allow_retrys=0,
and to turn off the retry function just set
allow_retrys=-1,