hi all,
sorry for posting off-topic. Really. Shouldn't. Couldn't.
I'm having a ****stupid**** problem with an 'upload file' CGI I
wrote based on the CGI.pm documentation.
The code that is failing is at the end. The file is opened
succesfully for writing (I did try and write a string in it). The CGI
parameter is 'seen' by my script but the *magic* that makes it work both
as a string and as a filehandle is somehow broken.
Weird enough, I have a standard file-upload that does work on the
same directories and files and from the same browsers. The script is
from http://www.terminalp.com/scripts/ , written by [EMAIL PROTECTED]
.
TIA.
====================
#!/usr/bin/perl
use CGI;
$| =1 ;
$query= new CGI;
print $query->header();
# Copy a binary file to somewhere safe
open (OUTFILE,">/net/projects/intercosta.net/vroot/upload/ul")
or print $!;
$totalbytes=0;
$filename = $query->param('uploaded_file');
while ($bytesread=read($filename,$buffer,1024)) {
print OUTFILE $buffer;
$totalbytes += $bytesread;
}
close OUTFILE ;
print "$filename\n";
print $totalbytes;
==================
--
- Martin Langhoff @ S C I M Multimedia Technology -
- http://www.scim.net | God is real until -
- mailto:[EMAIL PROTECTED] | declared integer -