in reply to Re: CGI, uploading multiple files
in thread CGI, uploading multiple files

I am open to any solution at the moment. This will act as a wrapper around a much more complex perl script which will be used internally by a few employees. I'll take a look at mojo.

Replies are listed 'Best First'.
Re^3: CGI, uploading multiple files
by poj (Abbot) on Mar 13, 2017 at 20:18 UTC

    Try it without the if block

    # if ($upload_file){ open (OUTFILE,">$upload_folder/$upload") or die $!;; binmode OUTFILE; while (<$upload_file>) { print OUTFILE; } # } # else { # print "<b>Guess it's broken</b><br/>"; # }

    Also, it might help to add this line while developing but take it out when finshed.

    use CGI::Carp 'fatalsToBrowser'; # use only for test/debug
    
    poj
      that just created empty files with the correct names.
        Try
        #my @files = $q->param('multi_files'); my @files = $q->upload('multi_files'); foreach my $upload (@files){ print "Upload this please -- $upload<br>"; #my $upload_file = $q->upload($upload); if ($upload){ open (OUTFILE,">$upload_folder/$upload") or die $!;; binmode OUTFILE; while (<$upload>) { print OUTFILE; } close OUTFILE; } else { print "<b>Guess it's broken</b><br/>"; } }
        poj