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

OnClientFileUploading args.set_cancel(true) behaviour question

2 Answers 61 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Andrew Currie
Top achievements
Rank 1
Andrew Currie asked on 30 May 2012, 12:29 PM
Hi,

I have an issue where setting args.set_cancel(true) in the OnClientFileUploading event doesn't seem to cancel the upload.

I have a small working example of this.

The example checks that you are not uploading two files with the same name.  Upon detecting that you are, it displays an alert and sets the cancel to true.  I note however that when posting back, I still get a FileUploaded server event for each file, including the cancelled one(s).

How do I know that one of those is actually cancelled?  What is the expected functionality of cancelling the upload through this method?  All that seems to happen is the file indicator turns red but otherwise it seems it makes no difference to functionality.

Please help! :)

Andrew

2 Answers, 1 is accepted

Sort by
0
Andrew Currie
Top achievements
Rank 1
answered on 30 May 2012, 02:01 PM
Further to this, I note that this is only happening with smaller files.  With larger files this issue does not occur presumably because the combined file size is meaning the file doesn't post back.

The set_cancel(true) is definitely not working as I would have expected it to.
0
Peter Filipov
Telerik team
answered on 01 Jun 2012, 10:29 AM
Hi Andrew,

It happens when silverlight module is used to upload files. Unfortunately the Silverlight plugin is causing some issues that are beyond our control. To avoid the problematic behavior please set DisablePlugins property to true.

All the best,
Peter Filipov
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 RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
AsyncUpload
Asked by
Andrew Currie
Top achievements
Rank 1
Answers by
Andrew Currie
Top achievements
Rank 1
Peter Filipov
Telerik team
Share this question
or