Hi,
I have created a script to upload files

$filename = $_FILES['Filedata']['name'];	

$filetmpname = $_FILES['Filedata']['tmp_name'];	

$fileType = $_FILES["Filedata"]["type"];

$fileSizeMB = ($_FILES["Filedata"]["size"] / 1024 / 1000);

//Irrelevant validation here

move_uploaded_file($_FILES['Filedata']['tmp_name'], $_SERVER['DOCUMENT_ROOT']."/content/songs/file.mp3");

And that returns OK to the browser allong with my success message but the file doesn't exist, when I look in the sites error log i get

[Fri Oct 23 09:53:44 2009] [error] [client 192.168.0.1] PHP Warning:  move_uploaded_file(Photo on 2009-10-09 at 22.51 #2.jpg) [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]: failed to open stream: Permission denied in /var/www/html/development/scripts/open/signup/uploadtest.php on line 25, referer: http://dev-env-1.samrudge.co.uk/account/main
[Fri Oct 23 09:53:44 2009] [error] [client 192.168.0.1] PHP Warning:  move_uploaded_file() [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]: Unable to move '/phptemp/phpTxmy2f' to 'Photo on 2009-10-09 at 22.51 #2.jpg' in /var/www/html/development/scripts/open/signup/uploadtest.php on line 25, referer: http://dev-env-1.samrudge.co.uk/account/main

/phptemp/ has CHMOD 777 and apache has read write access to the entire web directory

Whats wrong?
Thanx,
Sam

by the error logs it seems that your code is not able to access the file,check the permissions to that file.sometimes it might be the case that the file is permitted but the folder outside of it not , so check with that too.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.