etzel42 has asked for the wisdom of the Perl Monks concerning the following question:
I have also tried it this way:use CGI; sub doUpload { my ($buffer); $query = new CGI; $filename = $query->param("file"); $filename =~ s/.*[\/\\](.*)/$1/; $myupload = $query->upload("file"); if ($filename =~ /.mp3/) { open (UPLOADFILE, ">$dirpath/$filename"); while (read($myupload, $buffer, 1024)) { print UPLOADFILE $buffer; } close (UPLOADFILE); } print "Location: $cgipath?action=success\nURI: $cgipath?action=success +\n\n"; }
Thanks.if ($filename =~ /.mp3/) { open (UPLOADFILE, ">$dirpath/$filename"); while ( <$myupload> ) { print UPLOADFILE; } close (UPLOADFILE); }
I thought I got it working, but I didn't. It's not creating a file at all. I added this to it:-----------------------
or 100MB. How do I check the return value of "OPEN"?$CGI::POST_MAX = 102400;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File Uploading
by mandog (Curate) on Oct 15, 2003 at 22:23 UTC | |
|
Re: File Uploading
by vek (Prior) on Oct 16, 2003 at 17:04 UTC |