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

RadAsyncUpload uploading status

1 Answer 169 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Sathiyamurthy
Top achievements
Rank 1
Sathiyamurthy asked on 30 Sep 2011, 02:08 PM

Hi this my first thread.

  1. I need know the status of RadAsynUploading control uploading files. So that I can ask confirmation while clicking the submit button in the page like file uploading inprogress.
  2. The cancelled file also uploading, how to solve this issue.

1 Answer, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 05 Oct 2011, 04:14 PM
Hello Sathiyamurthy,

1). When a file is uploading css class ruUploaProgress is attached, when a file is uploaded ruUploadProgress ruUploadSuccess class is attached. When the uploaded file is invalid ruUploadFailure class is attached. You can use jQuery to check on submit button. Please review the following code sample:
<body>
    <form id="form1" runat="server">
    <telerik:radscriptmanager runat="server" id="RadScriptManager"></telerik:radscriptmanager>
    <telerik:radasyncupload runat="server" id="RadAsyncUpload1"
        maxfileinputscount="1" AllowedFileExtensions=".jpg">            
            </telerik:radasyncupload>
            <input type="button" value="Submit" onclick="checkFilesStatuses()"/>
    </form>
    <script type="text/javascript" language="javascript">
 
        var $ = $telerik.$;
 
        function checkFilesStatuses() {
            var upload = $find("RadAsyncUpload1")
            var uploadingFilesCount = $("span[class='ruUploadProgress']", upload.get_element()).length;
            var uploadedFilesCount = $(".ruUploadSuccess").length;
            var invalidFilesCount = $(".ruUploadFailure").length;
            alert("Uploading files: " + uploadingFilesCount + ", uplaoded files " + uploadedFilesCount + ", invalid files " + invalidFilesCount);
        }
 
                
  
    </script>
</body>

2). Even the file is uploaded ASP.NET framework will take care to delete it after a certain time(this happens because RadAsyncUpload is uploading the file on chunks, you can check that the file's size is not complete).

Kind regards,
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
Sathiyamurthy
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Share this question
or