CGI file upload - problems with file size...

D

DJ Stunks

Hey all,

I'm having a problem uploading a file larger than roughly 1MB using
CGI.pm, however I feel the problem may be coming from mod_perl or
apache.

Background - I am uploading an MS Excel spreadsheet using filefield via
CGI.pm. The second script should take this file (as the filehandle -
not saving the file to the filesystem), parse it using
Spreadsheet::parseExcel and output values from various rows/columns.

Versions - Apache/2.0.53 (Unix)
mod_perl/1.999.21
Perl/v5.8.0 i386-linux-thread-multi,
O/S: Linux 2.4.18-14smp,
RAM - 4GB...

Problem - with smaller XLS files (up to ~1MB) the script behaves well.
With a 1.43MB file, the apache error log records the following:

[Fri Jan 20 17:07:27 2006] [warn] -T switch is ignored, enable
with 'PerlSwitches -T' in httpd.conf\n
Out of memory!
[Fri Jan 20 16:55:48 2006] -e: Callback called exit.

You can see that the memory error message is not formatted in the
traditional apache way, and doesn't show who threw the error. This
seems odd...

I have tried setting

$CGI::pOST_MAX = 10_000 * 1024; # max file upload size to ~10MB

but it didn't make a difference. From the docs it would appear that
CGI.pm does not limit upload file sizes by default. It would also
appear that Apache does not limit filesizes by default either.

I would appreciate any advice. I have seen many posts on Google for a
similar problem in PHP but nothing useful in Perl.

TIA,
-jp
 
J

J. Gleixner

DJ said:
Hey all,

I'm having a problem uploading a file larger than roughly 1MB using
CGI.pm, however I feel the problem may be coming from mod_perl or
apache.

If it's coming from mod_perl or Apache, then why are you asking
in the perl group and without showing any code?

Try it without the CGI and/or Apache. Does your script parse the
large file without running out of memory?

Post a VERY short script, that will show the issue.
Perl/v5.8.0 i386-linux-thread-multi,

5.8.0 had some odd bugs. Upgrade that first.
 

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

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,701
Latest member
XavierQ83

Latest Threads

Top