CGI file upload - problems with file size...

Discussion in 'Perl Misc' started by DJ Stunks, Jan 21, 2006.

  1. DJ Stunks

    DJ Stunks Guest

    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
     
    DJ Stunks, Jan 21, 2006
    #1
    1. Advertising

  2. DJ Stunks

    J. Gleixner Guest

    DJ Stunks wrote:
    > 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.
     
    J. Gleixner, Jan 23, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2FyYXY=?=

    Upload a file without file Upload control - ASP.Net

    =?Utf-8?B?U2FyYXY=?=, Aug 2, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    2,497
    Bruce Barker
    Aug 3, 2005
  2. Heather Fraser
    Replies:
    0
    Views:
    649
    Heather Fraser
    Jul 5, 2004
  3. Replies:
    1
    Views:
    950
    Gabriel Genellina
    Nov 25, 2006
  4. Jason Cavett

    Preferred Size, Minimum Size, Size

    Jason Cavett, May 23, 2008, in forum: Java
    Replies:
    5
    Views:
    12,651
    Michael Jung
    May 25, 2008
  5. Hal Vaughan

    CGI Upload Problems

    Hal Vaughan, May 2, 2006, in forum: Perl Misc
    Replies:
    7
    Views:
    188
    Gunnar Hjalmarsson
    May 2, 2006
Loading...

Share This Page