I don't mean to sound like a complete moron, but I kind of got dumped into administering an existing Drupal site, and have very little Linux experience. How do I set the permissions for the images/ and the images/thumbs/ directory so that users can submit pictures to the site? I know it is something simple and probably trivial to most Linux gurus but I thank you in advance for helping me with this. For a newbie jumping in the deep end Drupal has been wonderfully easy to understand.
-Tom
Comments
Comment #1
roobul commentedI could only get it to work by setting the permissions to 777 on both directories.
Comment #2
adrinux commentedThe problem is generally one of which user owns the directories. The web server runs as a different user (usually something like www or nobody) than you. And that user needs permission to write to the directories. If you have root or sudo access you can change the owner of the directories to that which the web server runs under and you should be able to use more restrictive permissions than 777.
If you're on a shared web host you may be unable to make directories be owned by another user, in this case you need to use php, and let the server create the directories itself.
See this thread for a script you can use to create the directories:
http://drupal.org/node/view/6071
You need to create a parent directory with 777 perms then have the script create the directories within this one. Remember to delete the script once you're done.
(IMO this sort of functionality needs to be added to image.module or drupal, or we are going to see lots of support requests.)
Comment #3
adrinux commentedThe problem is generally one of which user owns the directories. The web server runs as a different user (usually something like www or nobody) than you. And that user needs permission to write to the directories. If you have root or sudo access you can change the owner of the directories to that which the web server runs under and you should be able to use more restrictive permissions than 777.
If you're on a shared web host you may be unable to make directories be owned by another user, in this case you need to use php, and let the server create the directories itself.
See this thread for a script you can use to create the directories:
move_uploaded_file
You need to create a parent directory with 777 perms then have the script create the directories within this one. Remember to delete the script once you're done.
(IMO this sort of functionality needs to be added to image.module or drupal, or we are going to see lots of support requests.)
Comment #4
bruno commentedUsing the file API in image module should solve this kind of issue, and others :-)
Comment #5
Robrecht Jacques commentedCurrent image.module does exactly that, giving an error if it can't create the needed directories.
Closing this issue. If you believe the issue is not fixed, please reopen it.