Hello everyone,
I've hunted on google, read the list archives. Here's what I've been
fooling with to upload the file:
$data = addslashes(fread(fopen($picture, "r"), filesize($picture)));
$len = strlen($data);
if ($fp = fopen("$image_path/$picture_name",
"wb")) {
if ($size = fwrite($fp, $data, $len)) {
print "<font face=Arial
size=2>Thanks, the image has been added to our database.</font>";
fclose ($fp);
}
else {
print "<font face=Arial
size=2>$picture_name couldn't be written to, perhaps some permissions are
wrong?";
}
}
else {
print "<font face=Arial
size=2>$picture_name couldn't be opened (or created), please try
again.</font>";
}
Here's the relavent form field:
<input type=file name=picture>
And here's the errors:
Warning: fopen("C:\\WINDOWS\\Desktop\\whiterain.jpg","r") - No such file or
directory in /home2/aanr.com/www/cyber_bulletin/admin/add.php on line 84
Warning: Supplied argument is not a valid File-Handle resource in
/home2/aanr.com/www/cyber_bulletin/admin/add.php on line 84
Warning: fopen("/home2/aanr.com/www/images//","wb") - Is a directory in
/home2/aanr.com/www/cyber_bulletin/admin/add.php on line 86
couldn't be opened (or created), please try again.
Anyone know how to fix this? I'm uploading an image from a windows hd to a
linux server.
Tyler Longren
Captain Jack Communications
[EMAIL PROTECTED]
www.captainjack.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]