1

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?

Rasclatt
  • 12,498
  • 3
  • 25
  • 33
Om Komawar
  • 251
  • 3
  • 19

3 Answers3

2

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()

TGammage
  • 134
  • 8
1

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.

Alex Goncharenko
  • 1,036
  • 2
  • 12
  • 22
1

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..

ankhzet
  • 2,517
  • 1
  • 24
  • 31