On Monday 22 November 2004 14:01, Michael Leung wrote:
Please do not top post.
> Thank you for your help. This is the output from PHP script:
> "upload_files is valid a directoryI am able to write to upload_files
> Warning: move_uploaded_file(upload_files/Water lilies.jpg)
> [function.move-uploaded-file]: failed to open stream: Permission
> denied in /var/www/html/simple_upload.php on line 58
>
> Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
> move '/tmp/phpHuSGRK' to 'upload_files/Water lilies.jpg' in
> /var/www/html/simple_upload.php on line 58"
>
> Well, this shows upload_files is writeable. Therefore, it should not
> be any error in permission setting issues.
Add these following tests to the top of your code:
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
if (is_readable($_FILES['userfile']['tmp_name'])) {
echo "I can read " . $_FILES['userfile']['tmp_name'];
}
if ($fp0 = fopen('upload/doodah', 'w')) {
echo 'I can open upload/doodah for writing';
}
if ($fp1 = fopen('upload/' . $_FILES['userfile']['name'], 'w')) {
echo 'I can open upload/' . $_FILES['userfile']['name'] . ' for
writing';
}
Also what is your safe_mode setting? Usually when something fails because of
safe_mode setting the error would explicitly say it failed because of
safe_mode setting.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
If you wish to succeed, consult three old people.
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php