![]() |
| ||
| File Upload Error Hi! I am using the following code for a file upload-
While it works fine on my localhost, when I upload it to the server, I get- Temporary Location is: /tmp/phpw1v73L Target Path is: /home/infotech/myhomepage/uploads/a.txt Warning: move_uploaded_file(/home/infotech/myhomepage/uploads/a.txt) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/infotech/myhomepage/upload.php on line 15 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpw1v73L' to '/home/infotech/myhomepage/uploads/a.txt' in /home/infotech/myhomepage/upload.php on line 15 There was an error uploading the file, please try again! ----------- Is it due to permissions? Because I am able to do mv /tmp/foo /home/infotech/myhomepage/uploads/ Any ideas? Thanks |
| ||
| Re: File Upload Error I think this may be to do with permissions on the folder. Your permissions are not the same as php's permissions. The fix depends on what server you are using, but in a Linux server you can use a chmod command on the directory to change the permissions. You need write access for the Other group of permissions (the second-last bit). Use the command chmod 766 to assign full access to the directory's owner, read/write access to the owner's group and read/write access to other users (which includes php/www). I'm not sure about a windows server sorry, maybe someone else can help if you are using a windows server. |
| ||
| Re: File Upload Error Worked like a charm, thanks for your reply! |
| All times are GMT -4. The time now is 10:08 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC