Reputation: 251
I have web server which allows for image uploading. When the user uploads an image, it uploads onto the server but when try to access the file using the browser from other pages it is giving me:
403 forbidden
What kind of permissions should the files have for accessing the images publicly?
Upvotes: 1
Views: 1377
Reputation: 134
i think the permission code you want to change it to is 0644
Here's how to change the permission of a file with php.
chmod()
Upvotes: 2
Reputation: 2569
At least, for reading =). That will be chmod('0644')
in PHP.
Make sure, that directory, where image files are placed, also is accessible for reading, thus both access rights and .htaccess
settings grants reading access..
Upvotes: 1
Reputation: 1066
Try 3-digit chmod 664
command. The last digit sets the permission for class 'others', which basically encloses all your client-side users. 4
stands for read-only.
Upvotes: 1