MySQL Forums
Forum List  »  Perl

Re: help for file uploading in perl
Posted by: Felix Geerinckx
Date: May 16, 2005 09:21AM

Devashish Saha wrote:

> $upload_dir = "httpd/html/guest4/load";

I suggest you use an absolute path.

> open UPLOADFILE, ">$upload_dir/$filename";

I suggest you test the return value or you open call:

open UPLOADFILE, ">...." or die "Could not open file: $!";

and check you webserver error log

> while ( <$upload_filehandle> ) {
> }

For binary data, I usually use something like:

while (read(FROM, $buf, 16384)) {
print TO $buf;

Please use BBCode to format your messages in this forum.

Options: ReplyQuote

Written By
Re: help for file uploading in perl
May 16, 2005 09:21AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.