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

How i can get file size

1 Answer 361 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Python
Top achievements
Rank 1
Python asked on 01 Jul 2015, 11:01 AM

How i can get file size on client for all files added in AsyncUpload before upload?

And how i can  view the upload progress of ALL files together as a progress bar in the upload control?

1 Answer, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 06 Jul 2015, 10:46 AM
Hi,

You can use the following code to get the size of a file: 
      <telerik:RadAsyncUpload runat="server" ID="upload" OnClientFileSelected="fileSelected"></telerik:RadAsyncUpload>
 
      <script>
 
          function fileSelected(sender, args) {
              var size = args.get_fileInputField().files[0].size;
          }
</script>

Note that this will be working only for modern browsers, where FileApi is supported. - IE10+,Chrome,FF

To monitor uploading progress of all files use ProgressArea:
AsyncUpload - Integration with RadProgressArea

Regards,
Hristo Valyavicharski
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
AsyncUpload
Asked by
Python
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Share this question
or