It may very well be just a timeout problem like joealba said, but your perl code could be the problem. (Your HTML form looks fine.) To elaborate:

When you submit a multipart form, your browser packages up the file you specified in the file field and sends it along in the HTTP request to the server. So the initial request is when the actual transfer takes place, which can make it appear that it's hung, when it's really just still sending. CGI.pm reads in the file, and places it in a temp file. Only then is your program really able to spit headers and content back to the browser. So if it's a big file and you're on a modem, it will appear to hang, and may even time out.

(You don't have to process the file, it will just be deleted if you don't.) Try a simple CGI response like:

#!/usr/bin/perl -w use strict; use CGI; my $q = new CGI; print $q->header(); if ($q->param()) { print $q->ul( 'Got Something:', $q->li( [map {"$_: ".$q->param($_)} $q->param()] ) ); } else { print 'Got squat, sorry'; }

Anyway, go ahead and post your code, someone will be able to spot the breaking point if there is one.

PS, I have noticed that in particular IE 5.5 on MacOS seems to have trouble sometimes with all of my CGI.pm-based upload scripts. If that's your OS, you might try debugging from another machine to be sure it's not a client-specific problem.


In reply to Re: CGI file upload - endless loop?? by sedhed
in thread CGI file upload - endless loop?? by lpoht

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.