Have you checked the error.log of your server to see if there are any error conditions raised while it ran?

The only way i can see it not returning the print "<p><b>Name</b> -- $name<br><b>Email</b> -- $email<br><b>Comments</b> -- $comments<br>"; contents is if the cgi process terminated wit an error before reaching that point, like dieing because it cannot open the file.

To catch what would otherwise be a terminal error you can wrap the code in an eval block like so

eval { open (OUTFILE,">$upload_folder/$upload") or die $!;; binmode OUTFILE; while (<$upload_file>) { print OUTFILE; } close OUTFILE; }; print 'error:'.$@.'<br>' if $@;
the point made by pojabout use CGI::Carp 'fatalsToBrowser'; may serve to do the same thing. Or it may identify another error

ps, what do you think should be in $upload_file? what parm has the same name as of one of the files to be uploaded, not the value, its name.

consider

my @files = $q->param('multi_files'); my @io_handles=$q->upload('multi_files'); foreach my $upload(@files){ print "Upload this please -- $upload<br>"; my $upload_file = shift @io_handles; if ($upload_file){ eval { open (OUTFILE,">$upload_folder/$upload") or die $!;; binmode OUTFILE; while ( my $bytesread = $upload_file->read($buffer,1024) ) { print OUTFILE $buffer; } close OUTFILE; }; print 'error:'.$@.'<br>' if $@; } else { print "<b>Guess it's broken</b><br/>"; } }
see http://search.cpan.org/~leejo/CGI-4.35/lib/CGI.pod#Processing_a_file_upload_field

you may also be interested in

my $type = $q->uploadInfo( $upload_file )->{'Content-Type'};
To determine if you need binmode and should use read, or if you dont want binmode and can use <$upload_file>


In reply to Re: CGI, uploading multiple files by huck
in thread CGI, uploading multiple files by edimusrex

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.