Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Thanks$fname =$query->param('filename'); $upload_dir="/usr/web/doc"; $upfile=$fname; $upfile=~ s/\\/\//g; ## Replace all \'s with /'s. ## Extract the upload file's name. @path=split(/\//,$upfile); $upload_file= $upload_dir."/".$path[$#path]; open(MYFILE,">$upload_file") || die $!; binmode MYFILE; while($bytesread=read($fname,$data,1024)) { $size+=$bytesread; print MYFILE $data; } close(MYFILE);
Edit: Added <code> tags. larsen
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: uploaded file is not proper
by Skeeve (Parson) on Jun 16, 2003 at 07:59 UTC | |
|
Re: uploaded file is not proper
by barrd (Canon) on Jun 16, 2003 at 11:11 UTC | |
|
(jeffa) Re: uploaded file is not proper
by jeffa (Bishop) on Jun 16, 2003 at 15:20 UTC | |
|
Re: uploaded file is not proper
by Anonymous Monk on Jun 16, 2003 at 09:41 UTC |