When uploading a file to your webserver most people are already aware that the folder where the file resides must have the correct permissions to accept the uploaded file.

In most cases this will be 755 or 777 (try 755 first, always leave 777 as a last resort), however, what do you do if the permissions are correct and the upload still fails ?

To help understand this, I will explain what happens when you upload a file using HTTP and PHP.

You select the file for upload, click Submit and the file uploads to a temporary directory on the webserver. The PHP script then validates this upload. This is done to ensure that nobody has tried to trick the system.

When the file has been validated it is copied to the destination folder, and the original file in the temporary directory is deleted.

Explaining this procedure should highlight where the problem occurs if the upload is failing. Does the temporary directory on the webserver have the correct permissions ? Probably not. Change the permissions to 755 (or 777, see note above) and this should resolve the problem.