Get File size

C

Code Monkey

Probably an old topic...not sure.

If I'm developing a web site with file upload, is it possible to get
the size of the file BEFORE the upload starts? I don't want to rely on
the web.config 'maxRequestLength' as if the user uploads say, a 20Mb
file and I want to limit them to 10Mb....it'll annoy the user.

Thanks
 
J

jeremiah johnson

It would have to be done on the client side somehow. JavaScript has no
awareness of a filesystem.

I've always just put on the page a message like "Max Upload Size: 2MB"
and that's never let me down.

jeremiah
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top