Upload Problems - Permissons could hold the key
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.
Comments
Change permission
How can I Change the permissions to 755 or 777? Please tell me in details.
Thank you,
Ten
RE: Change permission
You can do this in a number of ways. The most common methods are by using TELNET or FTP.
As the majority of web hosts do not provide TELNET access to the webserver, you will most probably need to do it using your FTP client.
In CuteFTP for example you would right click on a folder, select permissions and in the text box you would type 755 (or 777) depending.
You will find that different pieces of software accomplish this in many ways. I would suggest that your read the manuals for your FTP software and they will give you more accurate details.
copy to real dir
You must me logged in to write a comment.