File size

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

All,

I have a ASP.NET page using C# to upload a file to a server via the
filefield control. I would like to restrict the size of the file a user can
upload to say 1mb but would like to check the size of the file on the client
computers and not when the file has been uploaded. I am guessing I need to
use some client script can someone help me out?

Thanks
Msuk
 
Use ...
System.Web.UI.HtmlControls.HtmlInputFile

there

myFile.PostedFile.ContentLength; is the size of the file in byte..

Nirosh.
 
Hi,

AFAIK there is no way to control that in the client, you have to do it in
the server side using PostedFile.ContentLength

Cheers,
 
hi,

I would like to make the check at the client end thus saving the uploading
of the file it is it too big. Is there any client side script I could use to
check the size of the file before uploading it?

Thanks
Msuk
 
Hi,

NOP, You could search in a javascript NG for that answer but there is none
AFAIK.

If you do find one solution, please post it back here.

cheers,
 
Back
Top