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

How to validate MaxFileSize in Radupload?

12 Answers 570 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Long
Top achievements
Rank 1
Long asked on 23 Jul 2010, 08:42 AM
Problem 1:
I can't find funtion for validate MaxFileSize in Radupload.

Problem 2:
I have a funtion:

function validateRadUpload2(source, arguments) {
        arguments.IsValid = getRadUpload('<%= RadUpload2.ClientID %>').validateExtensions();
    }

But RadUpload2 in  RadGrid -> EditFormSettings -> FormTemplate.
How to get RadUpload2.ClientID ?


Please help me!
Thanks a lots!
Regards,

12 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 Jul 2010, 11:21 AM
Hello,


One suggestion is saving the client object of RadUpload in a client global variable. You can perform this in client side event - OnClientLoad() of RadUpload, thus you will be able to access the control in any of the client custom functions.

And, have you tried the approach shown in documentation in order to check the file size on client side?
Checking File Size on the Client


-Shinu.
0
Long
Top achievements
Rank 1
answered on 26 Jul 2010, 10:47 AM
Checking File Size on the Client
This not active. I try this. Please give me a better example.
Can you say more about OnClientLoad()?
Thanks you for your reply,
Regard,
0
Long
Top achievements
Rank 1
answered on 26 Jul 2010, 11:46 AM
I found the problem.
Code runs fine on Firefox, but can't run on Google Crome.
How to this code run on Google Crome?
Please help me.
Thanks a lot!!!
0
Yana
Telerik team
answered on 29 Jul 2010, 12:20 PM
Hello Long,

I was able to reproduce this issue in Chrome, actually the problem is that OnClientProgressUpdating event is not fired at all. We'll research this and will write you back. Thank you for your understanding.

Greetings,
Yana
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
0
Yana
Telerik team
answered on 16 Aug 2010, 11:40 AM
Hi Long,

I'm sorry for the delayed reply. Actually this is a known limitation of RadProgressArea in the webkit browsers as described here .

Best wishes,
Yana
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
0
Amjad
Top achievements
Rank 1
answered on 20 Jun 2011, 10:59 AM
hello;

guys am using upload control not async upload , and i have a maximum size limit to 1MB and i want to prompt an alert to the user if exceeds the limit .
hint; am not using progress bar how can i do that ?

Best Regards
Amjad
0
Shinu
Top achievements
Rank 2
answered on 20 Jun 2011, 12:08 PM
Hello Amjad,

RadAsyncUpload can automatically validate files using the AllowedFilesExtensions properties and the MaxFileSize property. RadAsyncUpload provides client-side event called OnClientValidationFailed. It is fired when the selected file has invalid extension or its size is higher than the MaxFileSize property.

Check out the following demo for more on this.
Upload / Validation.

Thanks,
Shinu.
0
Amjad
Top achievements
Rank 1
answered on 20 Jun 2011, 12:09 PM
Yes but i told you am using RadUpload NOT Async Upload
0
Shinu
Top achievements
Rank 2
answered on 20 Jun 2011, 02:08 PM
Hello Amjad,

Check out the following help document to achieve your scenario.
Checking File Size on the Client.

Thanks,
Shinu.
0
Amjad
Top achievements
Rank 1
answered on 20 Jun 2011, 02:10 PM
Yes i have seen this article before , i have told am not using progress bar what is the alternative solution ???!!!!
0
Cori
Top achievements
Rank 2
answered on 21 Jun 2011, 12:57 PM

Hello Amjad,

You can't validate the file size without the use of the RadProgressManager/RadProgressArea because they are the controls that know the file size, the RadUpload cannot determine a file's size on the client.

 

I hope that explains why you need the RadProgessManager/RadProgressArea to find out an uploaded file's size.

0
Peter Filipov
Telerik team
answered on 22 Jun 2011, 12:38 PM
Hello Amjad,

Cori is correct into the last post(21-Jun-2011). RadUpload is using a standard input type="file" control and it is not possible to chec the file size client-side due to browser limitation.

All the best,
Peter Filipov
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Upload (Obsolete)
Asked by
Long
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Long
Top achievements
Rank 1
Yana
Telerik team
Amjad
Top achievements
Rank 1
Cori
Top achievements
Rank 2
Peter Filipov
Telerik team
Share this question
or