I*added at the top of the script these lines:
PHP Code:
error_reporting(E_ALL);
ini_set("display_errors", 1);
and now get this:
Code:
Warning: move_uploaded_file(/home/wojtek/public_html/headfirst/ch05/guitarwars/images/001.jpg): failed to open stream: Permission denied in /home/wojtek/public_html/headfirst/ch05/guitarwars/addscore.php on line 38 Warning: move_uploaded_file(): Unable to move '/srv/www/tmp/phpCb8m0M' to '/home/wojtek/public_html/headfirst/ch05/guitarwars/images/001.jpg' in /home/wojtek/public_html/headfirst/ch05/guitarwars/addscore.php on line 38 upload failed
Which is much clear now. So the problem must be with the destination.
Following the advice on php.net, I*changed the user of images/ to ‘nobody’ and its rights to ’755’. But still with no success.
// edit
OK, I restored the ownership to my user (wojtek) and gave it 777 rights. Now it works!
The next issue that bothers me is how should I*set the destination? Is it OK*to give the whole, absolute path like this one:
PHP Code:
// define application constants
define('GW_UPLOADPATH', '/home/wojtek/public_html/headfirst/ch05/guitarwars/images/');
?
Can I*for example to make use of relative paths? Kinda ‘/~wojtek/headfirst/ch05/guitarwars/images/’?
Bookmarks