note 36905 deleted from features.file-upload by didou
| From: | didou@php.net | Date: | Sun, 26 Oct 2003 21:41:23 +0000 |
| Subject: | note 36905 deleted from features.file-upload by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59348@lists.php.net to get a copy of this message | ||
Note Submitter: adam@supervoters.com
----
I've just wasted an afternoon troubleshooting this problem - maybe I can save someone else the
trouble. I was using this function to save an uploaded file to my server:
move_uploaded_file($filename, "images/testimage.jpg");
But when I tried to view the file in the browser, it would give me a 403 error. I checked the
permissions on the newly-uploaded file and found that they were set differently than the permissions
for the other, accessible files on my server. I had to run a chmod on the file after I did the
move_uploaded_file like so:
move_uploaded_file($filename, "images/testimage.jpg");
chmod("images/testimage.jpg", 0644);
This eliminated my 403 error. Hope this helps someone.