in reply to Upload a file from a web form

Hi bodmin,

Your code doesn't make much sense, you appear to be attempting to open a directory rather than a filehandle:

open (OUTFILE,">>/usr/local/web/users/feedback");

How about something like:

#!/usr/bin/perl -w use strict; use CGI qw/:standard/; my $query = CGI->new(); my $file = "/usr/local/web/users/feedback/foo.bar"; open (WRITE, ">$file") || die "Couldn't open $file: $!\n"; my $fh = $query->param('upload_file'); print WRITE while (<$fh>); close (WRITE) || die "Couldn't upload $file: $!\n";

HTH ~ barrd

Update: antirice is correct, I posted this before coffee... "/me must wake up before (speaking||writing)"... I also /msg'd (him||her) to acknowledge that fact.

Replies are listed 'Best First'.
Re: Re: Upload a file from a web form
by antirice (Priest) on Jul 09, 2003 at 10:15 UTC

    Just a note: a filename doesn't require an extension and a directory's name can contain periods.

    antirice    
    The first rule of Perl club is - use Perl
    The
    ith rule of Perl club is - follow rule i - 1 for i > 1