views:

106

answers:

3

Hello,

I want to check the selected file size BEFORE uploading a file with the asp fileupload component. I can not use activex because the solution have to works on each browser (firefox, Chrome, etc..)

How can I do that ?

Thanks for your answers..

A: 

The short answer is that you can't.

Marc
A: 

I think it is possible using javascript look here

Yassir
Interesting approach (the last one), but does it work with non-images?
František Žiačik
A: 

I think you cannot do that. Your question is similar to this one : http://stackoverflow.com/questions/2014250/obtain-filesize-without-using-filesystemobject-in-javascript

The thing is that ASP.NET is a server-side language so you cannot do anything until you have the file on the server.

So what's left is client-side code (javascript, java applets, flash ?)... But you can't in pure javascript and the other solutions are not always "browser portable" or without any drawback

Julien N