I am trying to upload image through admin page, but it keeps saying:
[Errno 13] Permission denied: \'/path/to/my/site/media/userfolder/2014/05/26\'
<
Probably you are facing problem when a download request is made by the maybe_download function call in base.py file.
There is a conflict in the permissions of the temporary files and I myself couldn't work out a way to change the permissions, but was able to work around the problem.
Do the following...
Then it's all done. Hope it works for you.
Simply try:
sudo cp /source /destination
Another option is to ensure the file is not open anywhere else on your machine.
Just close the file in case it is opened in the background. The error disappears by itself
You need to change the directory permission so that web server process can change the directory.
To change ownership of the directory, use chown
:
chown -R user-id:group-id /path/to/the/directory
To see which user own the web server process (change httpd
accordingly):
ps aux | grep httpd | grep -v grep
OR
ps -efl | grep httpd | grep -v grep
supplementing @falsetru's answer : run id in the terminal to get your user_id and group_id
Go the directory/partition where you are facing the challenge. Open terminal, type id then press enter. This will show you your user_id and group_id
then type
chown -R user-id:group-id .
Replace user-id and group-id
. at the end indicates current partition / repository
// chown -R 1001:1001 . (that was my case)