This is a migrated thread and some comments may be shown as answers.

[Solved] When uploading multiple files, user cancelling file uploads does not always trigger OnComplete

4 Answers 89 Views
Upload
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sebastian S
Top achievements
Rank 1
Sebastian S asked on 28 Nov 2011, 11:49 PM
Hi,
We've noticed a problem that occurs irregularly when uploading multiple files (Chrome/Firefox). 
When the user cancels multiple uploads, the .OnComplete handler does not always get triggered
(sometimes it is triggered before the cancel).

Code is as below. Help!

Sebastian

@(Html.Telerik().Upload()
		.Name("files")
		.Multiple(true)
		.Async(async => async
			.Save("Save""Job")
			.AutoUpload(true)
		)
		.ClientEvents(events => events
			.OnComplete("onUploadComplete")
			.OnError("onUploadError")
			.OnCancel("onUploadCancel")
			.OnSuccess("onUploadSuccess")
			)
)
<script type="text/javascript">
	function onUploadCancel(e) {
		console.log('upload cancel :' + e.files[0].name);
 
		//setTimeout('$(".t-upload-files").remove();', 1300);
	}
 
	function onUploadComplete(e) {
		console.log('upload complete');
		//$('.t-upload-files').remove();
		setTimeout('$(".t-upload-files").remove();', 1300);
	}
 
	function onUploadError(e) {
		console.log('upload error');
		console.dir(e);
	}
 
	function onUploadSuccess(e) {
		console.log('upload success: ' + e.files[0].name);
		console.dir(e);
	}
</script>

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 01 Dec 2011, 09:01 AM
Hi Sebastian S,

I reproduced the case in which the OnComplete event never gets fired. It seems to occur when you cancel the last upload. We will try to fix this in one of the next official releases.
Could you share a little more information in which circumstances the OnComplete event gets fired before the OnCancel? Thanks in advance.

Greetings,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Sebastian S
Top achievements
Rank 1
answered on 01 Dec 2011, 10:03 PM
Can't really give you an exact example(It seems pretty random) - but it usually happens when uploading multiple files and a few files in the process of uploading get cancelled.
0
Accepted
T. Tsonev
Telerik team
answered on 13 Dec 2011, 12:55 PM
Hi Sebastian,

This bug is fixed and the fix will be available in the next internal build.

As a token of gratitude for your involvement your Telerik points have been updated.

Greetings,
Tsvetomir Tsonev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Sebastian S
Top achievements
Rank 1
answered on 14 Dec 2011, 02:03 AM
Thanks Dude :) Please let me know when the fix is ready.

Cheers,
Sebastian
Tags
Upload
Asked by
Sebastian S
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Sebastian S
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or