MESSAGE
DATE | 2003-10-25 |
FROM | Joe Villari
|
SUBJECT | Subject: [hangout] CGI file Upload Question
|
I've got my directory permissions straight now. $fh comes in undefined, which cause the script to bomb later when called, even though $file is defined. I think this is the link to the temporay file from upload. What am I missing?
Thanks Joe
#!/usr/bin/perl
use strict; use CGI;
use Fcntl qw(:DEFAULT :flock); use constant UPLOAD_DIR => "/var/www/html/eface/client_pics"; use constant BUFFER_SIZE => 16_384; use constant MAX_FILE_SIZE => 1_048_576; #Limit files to 1MB use constant MAX_DIR_SIZE => 20 * 1_048_576; #Limit total to 20MB use constant MAX_OPEN_TRIES => 100;
$CGI::DISABLE_UPLOADS = 0; $CGI::POST_MAX = MAX_FILE_SIZE;
my $formdata = CGI->new; $formdata->cgi_error and error ($formdata, "Error transferring file: " . $formdata->cgi_error); my $file = $formdata->param("file"); my $filename = $formdata->param("filename"); my $fh = $formdata->upload($file); my $buffer = "";
print STDERR "$file\n"; print STDERR "$filename\n"; print STDERR "$fh\n";
____________________________ NYLXS: New Yorker Free Software Users Scene Fair Use - because it's either fair use or useless.... NYLXS is a trademark of NYLXS, Inc
|
|