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

RadAsyncUpload all files uploaded event

3 Answers 312 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
zozzancs
Top achievements
Rank 1
zozzancs asked on 20 Jul 2010, 01:15 PM
Hello,

Is there an event for RadAsyncUpload that tells me that all the uploads are finished?
It would be nice if I could show/hide controls according to this event, or even better: initiate a postback when all the files are uploaded.

Thank You!

3 Answers, 1 is accepted

Sort by
0
Accepted
Lighthouse Developer
Top achievements
Rank 1
answered on 20 Jul 2010, 09:29 PM
Hi Zoltan,
One way to do to this is in client side,using the onClientFileSelected and OnClientFileUploaded events.
You can increase a counter in the OnClientFileSelected, when the user selects a file to upload (ex.selectedFilesCounter), and in the OnClientFileUploaded method increase another counter(ex.uploadedFiles).
When the selectedFilesCounter = uploadedFiles then you can raise an event or perform postback etc.

Thats what I have think for a similar senario.
Hopefully this can work for you too.
0
zozzancs
Top achievements
Rank 1
answered on 29 Aug 2010, 10:30 PM
I just realized that when i use multifieupload, onClientFileSelected and OnClientFileUploaded fires only ones, when the page loads and never again. It seems, they just simpy do not work.

<script type="text/javascript">
   function print(input) {
       alert(input);
   }
</script>
 
<telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" AllowedFileExtensions="jpg" onClientFileSelected="print('select')" OnClientFileUploaded="print('upload')" MultipleFileSelection="Automatic">
</telerik:RadAsyncUpload>
0
Genady Sergeev
Telerik team
answered on 30 Aug 2010, 04:46 PM
Hello zozzancs,

Your way of testing whether the OnClientFileUploaded event has fired in unreliable and will cause JavaScript errors in modern browsers such as FireFox 3.0 + and IE8. Please add correct handler for the FileUploaded event and you will notice that it is being fired for all files that were selected via multiple selection:

<script type="text/javascript">
        function fileUploaded(sender, args) {
            alert('file uploaded');
        }
 
    </script>
   
    <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1" OnClientFileUploaded="fileUploaded" MultipleFileSelection="Automatic" >
    </telerik:RadAsyncUpload>


Kind regards,
Genady Sergeev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
AsyncUpload
Asked by
zozzancs
Top achievements
Rank 1
Answers by
Lighthouse Developer
Top achievements
Rank 1
zozzancs
Top achievements
Rank 1
Genady Sergeev
Telerik team
Share this question
or