Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How to check the size of each files that are being uploaded

Reply
Thread Tools

How to check the size of each files that are being uploaded

 
 
tower.grv@gmail.com
Guest
Posts: n/a
 
      09-03-2008
Hello.
I am developing cgi perl script for uploading files with uploading
progress bar.
Now i have script that do this good.
While uploading i must to know total size of the file that is being
uploaded.
It is not problem becouse there is global variable
$ENV{CONTENT_LENGTH} that contains the lenght of the attachment.

The problem is when 2 or more files are bieng uploaded.

How can i know the size of each file?
I use CGI->new(\&hook) method to catch file uploading process.
 
Reply With Quote
 
 
 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      09-03-2008
"(E-Mail Removed)" <(E-Mail Removed)> wrote:
> Hello.
> I am developing cgi perl script for uploading files with uploading
> progress bar.
> Now i have script that do this good.


How does it work? Does it use a separate frame for the monitoring?

> While uploading i must to know total size of the file that is being
> uploaded.
> It is not problem becouse there is global variable
> $ENV{CONTENT_LENGTH} that contains the lenght of the attachment.
>
> The problem is when 2 or more files are bieng uploaded.
>
> How can i know the size of each file?


Strictly on the server, you can't. At least not until each file is done
being sucked down by the server and the next "multipart/form-data" starts
arriving.

You might be able to craft some javascript running on the client side that
will check on the local file size and encoded it into the form submission.

But I don't see the point. As a user, I'd want to know when the upload is
likely to be done. What do I gain by knowing what each individual
component is doing?

> I use CGI->new(\&hook) method to catch file uploading process.


Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
 
Reply With Quote
 
 
 
 
tower.grv@gmail.com
Guest
Posts: n/a
 
      09-04-2008
> Partial solution is to use javascript to check file sizes before user click on
> Send button. But be sure to warn users which have javascript disabled in
> browser. It is very simple:
>
> <body>
> <noscript>
> <div style="border: 2px solid red">You have not javascript enabled, please
> enable it.</div>
> </noscript>
> --

I tried to get file size with javascrip but i found that it is
imposiblem. Browsers don't allow this operation.
Do you know how to do this?
 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
check uploaded file's file size? h3m4n Python 2 07-08-2006 08:56 PM
Virus check files being uploaded. rajesh ASP .Net 0 10-29-2003 11:53 PM
Virus-Scanning uploaded files uploaded? Matt G ASP .Net 1 08-22-2003 05:44 AM



Advertisments