How to validate MaxFileSize in Radupload?

Thread is closed for posting
13 posts, 0 answers
  1. Long
    Long avatar
    13 posts
    Member since:
    Jul 2010

    Posted 23 Jul 2010 Link to this post

    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,
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 23 Jul 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Long
    Long avatar
    13 posts
    Member since:
    Jul 2010

    Posted 26 Jul 2010 Link to this post

    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,
  5. Long
    Long avatar
    13 posts
    Member since:
    Jul 2010

    Posted 26 Jul 2010 Link to this post

    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!!!
  6. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 29 Jul 2010 Link to this post

    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
  7. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 16 Aug 2010 Link to this post

    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
  8. Amjad
    Amjad avatar
    36 posts
    Member since:
    Dec 2010

    Posted 20 Jun 2011 Link to this post

    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
  9. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 20 Jun 2011 Link to this post

    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.
  10. Amjad
    Amjad avatar
    36 posts
    Member since:
    Dec 2010

    Posted 20 Jun 2011 Link to this post

    Yes but i told you am using RadUpload NOT Async Upload
  11. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 20 Jun 2011 Link to this post

    Hello Amjad,

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

    Thanks,
    Shinu.
  12. Amjad
    Amjad avatar
    36 posts
    Member since:
    Dec 2010

    Posted 20 Jun 2011 Link to this post

    Yes i have seen this article before , i have told am not using progress bar what is the alternative solution ???!!!!
  13. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 21 Jun 2011 Link to this post

    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.

  14. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 22 Jun 2011 Link to this post

    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.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017