Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Upload file size

Reply
Thread Tools

Upload file size

 
 
Lau Lei Cheong
Guest
Posts: n/a
 
      06-23-2004
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

--
If you want to mail to me, please replace all instance of "e" to "a" in my
email address. Thank you.
Sorry for any inconvience caused, but I there's many spam-mailers.



 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      06-23-2004
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.

"Lau Lei Cheong" <(E-Mail Removed)> wrote in message
news:#d$(E-Mail Removed)...
> 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
>
> --
> If you want to mail to me, please replace all instance of "e" to "a" in my
> email address. Thank you.
> Sorry for any inconvience caused, but I there's many spam-mailers.
>
>
>



 
Reply With Quote
 
 
 
 
Joe Fallon
Guest
Posts: n/a
 
      06-24-2004
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.
--
Joe Fallon



"Lau Lei Cheong" <(E-Mail Removed)> wrote in message
news:%23d$(E-Mail Removed)...
> 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
>
> --
> If you want to mail to me, please replace all instance of "e" to "a" in my
> email address. Thank you.
> Sorry for any inconvience caused, but I there's many spam-mailers.
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mega pixels, file size, image size, and print size - Adobe Evangelists Frank ess Digital Photography 0 11-14-2006 05:08 PM
CGI file upload - problems with file size... DJ Stunks Perl Misc 1 01-23-2006 05:35 PM
Upload a file without file Upload control - ASP.Net =?Utf-8?B?U2FyYXY=?= ASP .Net 3 08-03-2005 01:09 AM
File Upload and File Size Limitations Robert Strickland ASP .Net 6 11-01-2004 06:13 AM
Upload file Check file size lawrence ASP .Net 4 06-10-2004 08:02 PM



Advertisments