I have php upload problem, I have the following code:
define('GW_UPLOADPATH', '/var/www/train/ch5/images/');
$name = $_POST['name'];
$score = $_POST['score'];
$screenshot = $_FILES['screenshot']['name'];
$target = GW_UPLOADPATH.$screenshot;
echo $_FILES['screenshot']['tmp_name'].'<br/>';
move_uploaded_file($_FILES['screenshot']['tmp_name'], $targe)
or die("Upload Error!");
I get upload error! The temporary file where file is uploaded is:
/tmp/php9Khayp
but in /tmp I can not find this file. I am working on Ubuntu 10.10. Can anyone say me where is the problem?
apache error.log:[Wed Aug 10 20:54:17 2011] [error] [client ::1] PHP Warning: move_uploaded_file(/var/www/train/ch5/images/phizsscore.gif): failed to open stream: Permission denied in /var/www/train/ch5/addscore.php on line 22, referer: http://localhost/train/ch5/addscore.php
[Wed Aug 10 20:54:17 2011] [error] [client ::1] PHP Warning: move_uploaded_file(): Unable to move '/tmp/phpmkZEr3' to '/var/www/train/ch5/images/phizsscore.gif' in /var/www/train/ch5/addscore.php on line 22, referer: http://localhost/train/ch5/addscore.php
[Wed Aug 10 20:54:18 2011] [error] [client ::1] File does not exist: /var/www/favicon.ico