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

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

5 Answers 195 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Manish
Top achievements
Rank 2
Manish asked on 31 Aug 2011, 11:00 AM
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.

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 31 Aug 2011, 11:52 AM
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.
0
Manish
Top achievements
Rank 2
answered on 31 Aug 2011, 12:36 PM
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.
0
Kevin
Top achievements
Rank 2
answered on 31 Aug 2011, 12:52 PM
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.
0
Peter Filipov
Telerik team
answered on 02 Sep 2011, 09:49 AM
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 >>

0
Manish
Top achievements
Rank 2
answered on 27 Feb 2012, 10:43 AM
Thanks all of you for your concern. your idea works.

Thanks
Manish.
Tags
Upload (Obsolete)
Asked by
Manish
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Manish
Top achievements
Rank 2
Kevin
Top achievements
Rank 2
Peter Filipov
Telerik team
Share this question
or