JimJx has asked for the wisdom of the Perl Monks concerning the following question:
After thinking I had my probs straightened out, I ran into one I can't really seem to find any info on....
When running the script below, I get Short Read: wanted 437, got 0
My brain, which is admittedly a little fried today, guesses that the script is not getting the bytes it expects. Hence the "wanted 438, got 0" part.
The question I have now, is can anyone spot where the problem lies or know what can cause this error?
Thanks!
Jim
#!/usr/local/bin/perl use CGI; $query = new CGI; print $query->header; print $query->start_html(-title=>"UPLOAD PLEASE"); # retrieve the upload file name. unless ($file = $query->param('fileID')) { &showError('No file name specified.'); } @pathName = split(/\\/,$file); $newFile ='/home/users/web/b2578/pow.royridgeway/htdocs/Roy/'; $newFile .= pop(@pathName); open(OPF,">$newFile") || &showError("Failed to open OPF, $!"); print "<P><CENTER>Uploading <BR>$fileID <BR>to<BR>$newFile<BR></CENTER +></P>\n"; while ($bytesread=read($file,$buffer,1024)) { print OPF "$buffer"; } close OPF; print $query->end_html; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Short read error?
by GrandFather (Saint) on Feb 19, 2007 at 19:47 UTC | |
by JimJx (Beadle) on Feb 19, 2007 at 19:59 UTC | |
|
Re: Short read error?
by Anonymous Monk on Feb 19, 2007 at 23:37 UTC | |
|
Re: Short read error?
by cdarke (Prior) on Feb 19, 2007 at 19:51 UTC | |
by JimJx (Beadle) on Feb 19, 2007 at 20:03 UTC | |
by cdarke (Prior) on Feb 20, 2007 at 10:53 UTC | |
|
Re: Short read error?
by varian (Chaplain) on Feb 20, 2007 at 08:13 UTC |