Upload file size

L

Lau Lei Cheong

Hello,

Is there a way to determine the size of a file in InputFile control
before it starts uploading(i.e.: wants to determine the file size at
client-side)?

The checking cannot be done on server-side because we'll have to wait
the HttpRequest stream transfer complete before the program starts to run.
We cannot limit the filesize by setting maxRequestLength because there'll be
more than one upload at a time. We've tried to add a hidden control with
name="MAX_FILE_SIZE" immediately after the form tag and found it not
working(at least in IE6SP1 I'm using, do I need to add one for each upload
control?)

I know that there's a method which use javascript to open the file and
gather the filesize information before it starts to upload, but since I do
not have the digitial certificate to sign the script, this is not possible
for me.

Is there such way without signing codes works? Thanks a lot.

Regards,
Lau Lei Cheong
 
K

Kevin Spencer

It must be done on the client. Therefore, you will need a client-side app
(JavaScript, Java Applet, ActiveX Control, etc) to do the work.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
J

Joe Fallon

There is no built-in way to do this.
There is a very long thread out there somewhere which discusses this issue
in detail.
It lasted for about a year.
As I recall, they posted 90% of the code required to do this and then sold
it to a 3rd party company.
So now you can buy the functionality (it isn't free)

It involved writing an HTTP Handler (I think).
Then you gain complete control over the request and can check file size and
use progress bars.
 

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

Similar Threads

upload file/size 6
Upload File Size 2
File Upload Frustration 1
File Upload 3
Checking file upload size 1
File Upload Folder Permissions 5
Upload file functionality fails randomly 2
File upload - Progress bar 1

Members online

Forum statistics

Threads
473,755
Messages
2,569,538
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top