On Mon, 2004-08-02 at 17:34, Alex Brelsfoard wrote:
>       open (UPLOAD, ">$filepath") || &Error("Could not write $filepath");
>       while ($bytesread=read($picture,$buffer,1024))
>       { print UPLOAD $buffer; }
>       close (UPLOAD);
> 
> $picture is the path to the picture on the user's system.

And how pray tell are you accessing the users system? ;-} And read()
wants an open file handle. You _are_ using strict and warnings, right?

Assuming your using CGI.pm (and you really do want to for this sort of
thing, IMHO) all you should need to add to your CGI is:
        use CGI qw(:standard);
        my $cgi = new CGI;
        my $picture = $cgi->upload('forms_file_field_name');
        &Error("no file?") unless defined $picture; # your &Error
        
just before the code you have above.

> $filepath is the full path (including filename) to the file I would like
> to write.
> I'm doing this from a windows XP desktop to a RedHat 9 server.
> The file will be created, but it is a zero-byte file.  Strange that it can
> create the file, but not put any content into it.  Must be having problems
> reading the file from the desktop.

Not strange at all. Looks like you had no problem creating the file, but
I think you weren't reading in any data. HTH

-- 
Sean Quinlan <[EMAIL PROTECTED]>

_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to