Andre_br has asked for the wisdom of the Perl Monks concerning the following question:
I'd like to ask for thy help with this.
I used to do that this way:
But now the size of this form's other input fields is getting very difficult to measure, and my users are complaining the size measure rejects files below the limit I declare as maximum.my $q = new CGI; my $filehandle = $q->upload("file"); ... my $file_size = $ENV{CONTENT_LENGTH} - $size_other_fields - $size_for +m_structure; if ( $size > $limite ) { die "Wow, file too big! Bye!"; }
Is there another way to do it? I mean, another way to measure the size of this uploaded file itself, without relying on the $ENV{CONTENT_LENGTH}?
Thanks a lot
André
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Limiting size of uploads
by jZed (Prior) on Jun 01, 2006 at 00:47 UTC | |
|
Re: Limiting size of uploads
by monkfan (Curate) on Jun 01, 2006 at 05:38 UTC | |
|
Re: Limiting size of uploads
by TedPride (Priest) on Jun 01, 2006 at 05:03 UTC | |
|
Re: Limiting size of uploads
by qbxk (Friar) on Jun 02, 2006 at 22:27 UTC | |
by Andre_br (Pilgrim) on Jun 05, 2006 at 18:18 UTC |