How to check file size of uploaded file in raduploader in javascript

Thread is closed for posting
6 posts, 0 answers
  1. Manish
    Manish avatar
    64 posts
    Member since:
    Jul 2011

    Posted 31 Aug 2011 Link to this post

    Hi,

    I want to check file size of the uploaded file in rad uploader. Actually i am not using the
    RadProgressArea

    But i want to make alert of the the file size in the javascript.

     function checkExtension(radUpload, eventArgs) {

    Now what i have to wright here ?       

            }

    <telerik:RadUpload ID="RadUploadLogo" MaxFileSize="5242880" runat="server" AllowedFileExtensions=".jpg,.gif,.jpeg,.png,.bmp"
                        OnClientFileSelected="checkExtension" ControlObjectsVisibility="None" InputSize="35" Height="24px"
                        Style="position:absolute;top:8px;left:-15px;">
                        <Localization Select="logo:"/>
                    </telerik:RadUpload>



    Thanks
    Manish.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 31 Aug 2011 Link to this post

    Hello Manish,

    Take a look at the following help documentation which explains how to check file size from client side.
    Checking File Size on the Client.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Manish
    Manish avatar
    64 posts
    Member since:
    Jul 2011

    Posted 31 Aug 2011 Link to this post

    Hi,

    Thanks for your reply. But I have already mentioned in my post that i am not using
    RadProgressArea
    and you told me example of that. So please tell me about that what i have asked.


    Please help.


    Thanks
    Manish.
  5. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 31 Aug 2011 Link to this post

    Hello Manish,

    To Princy's point, you can't check the file size of a file in RadUpload, when using javascript, without the use of RadProgressArea. That is the only way you can do it.
  6. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 02 Sep 2011 Link to this post

    Hello Manish,

    Kevin is correct. RadUpload control is using a standard input type="file" control. With it is not possible to check the file size client-side. To validate the file size on the client please use the RadAsyncUpload control.

    Greetings,
    Peter Filipov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  7. Manish
    Manish avatar
    64 posts
    Member since:
    Jul 2011

    Posted 27 Feb 2012 Link to this post

    Thanks all of you for your concern. your idea works.

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