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

How to get uploading file size on select event in client side?

3 Answers 93 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Denius Valiant
Top achievements
Rank 1
Denius Valiant asked on 10 Apr 2013, 09:22 AM
Hi,

How to get uploading file size on select event in client side?
I need to get uploading file size before a file will be uploaded.

Thank you in advance.

3 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 11 Apr 2013, 10:38 AM
Hi Denius,

You can use the OnClientFileUploaded event and get the length of the file with the following code:
function OnClientAdded(sender, args) {
      alert( args.get_fileInfo().ContentLength);
   }

Kind regards,
Kate
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.
0
Denius Valiant
Top achievements
Rank 1
answered on 11 Apr 2013, 11:59 AM
Hi,

Sorry, I don't understand your explanation.
As I understand the OnClientFileUploaded client-side event occurs after a file has been uploaded. I need to get uploading a file size before the file will be uploaded.And the OnClientAdded client-side event occurs when a new row has just been added to the RadAsyncUpload control. It's event of UI action.
Could you please explain again.

Best regards.
0
Kate
Telerik team
answered on 11 Apr 2013, 01:51 PM
Hello Denius,

Unfortunately with the current implementation of the RadAsyncUpload control it is not possible to get the size of the file using the OnClientAdded event. Therefore I suggested a later event where this value is available on the client side.

Regards,
Kate
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
Denius Valiant
Top achievements
Rank 1
Answers by
Kate
Telerik team
Denius Valiant
Top achievements
Rank 1
Share this question
or