RadAsyncUpload all files uploaded event

4 posts, 1 answers
  1. zozzancs
    zozzancs avatar
    24 posts
    Member since:
    Dec 2009

    Posted 20 Jul 2010 Link to this post

    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!
  2. Answer
    Lighthouse Developer
    Lighthouse Developer avatar
    34 posts
    Member since:
    Feb 2010

    Posted 20 Jul 2010 Link to this post

    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.
  3. zozzancs
    zozzancs avatar
    24 posts
    Member since:
    Dec 2009

    Posted 29 Aug 2010 Link to this post

    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>
  4. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 30 Aug 2010 Link to this post

    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
Back to Top