Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Uploading and finding size.

by Zaxo (Archbishop)
on Jun 16, 2002 at 06:06 UTC ( #174902=note: print w/ replies, xml ) Need Help??


in reply to Uploading and finding size.

say I was uploading a file in perl, well how would I find the size of that file before uploading it

That sounds like client side.

JUST the CGI module, can't you do it with lenth(), or something.

That sounds like server side.

It sounds like you want to do a simple file upload in cgi. CGI covers that well. The clientside cruft sounds like you have to deal with inexperienced page designers. It may be a political problem to seperate the two.

On serverside, you can set CGI.pm's upload limit, but you have no way (we all hope) of illegally cracking the clients file system to preview uploads.

Update: ++rob_au, your remarks are right on the money.

After Compline,
Zaxo


Comment on Re: Uploading and finding size.
Re: Re: Uploading and finding size.
by rob_au (Abbot) on Jun 16, 2002 at 07:55 UTC
    I agree, it sounds like Anonymous Monk is looking for a solution that would best encompass both client-side and server-side routines - However, for basic upload size determination, the CONTENT_LENGTH environment variable can be used to find the size of the POST component of the multi-part request - This approach has merit where the server-side application may need to manipulate the uploaded file via a process where there are subsequent limits on file size. It should also be noted to that this is the same way by which CGI.pm imposes POST size restrictions as set by the $CGI::POST_MAX variable.

    An example as to how one can make use of the CONTENT_LENGTH environment variable to impose custom handling of over-size multi-part requests can be found here.

     

      worked, great, Thanks

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://174902]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2014-09-22 11:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (189 votes), past polls