4

I am getting this error while changing the logo of my site,

i have tried changing the permission through hosting provider, added php_value safe mode 0 in .htaccess file and even added one file in drupal folder named php.ini with

safe_mode = Off
file_uploads = On
upload_max_filesize = 256M

but still i am unable to change the logo and getting the error

File upload error. Could not move uploaded file.

3
  • Did you check the permissions on your files (sub)folder(s)? Are these set to 755? Commented Apr 13, 2014 at 19:34
  • I did 755 then it didnt work, den i set it to 777 then also it was not working.
    – asalug
    Commented Apr 17, 2014 at 11:54
  • 1
    This can also happen if your web installation exceeds its disk quota. Commented Aug 18, 2015 at 17:54

2 Answers 2

2

Had a same problem. The best way to fix it is to:

  1. Update the folder permissions on /sites/default to 777
  2. Remove /sites/default/files folder
  3. Go to /admin/config/media/file-system and click save so drupal re-creates the files folder.
  4. Update the folder permissions back to 755 on /sites/default.

On my server when website creates a file or folder, the owner is set to nobody.nobody and since I already had a lot of files in my /sites/default/files folder all I had to do is update the ownership and permissions:

  1. chown -R nobody.nobody ./sites/default/files
  2. chmod -R 755 ./sites/default/files

Good luck!

1
  • Be careful with that last command. It actually sets folders and files to a 755 permissions. This means that the owner "nobody" can execute files. It is better to set files to 644 and folders to 755. To only set the folder to 755, go to /sites/default/ and use the following command: find files/ -type d -exec chmod -R 0755 {} \;. This will find every folder and set only the folder permission (type -d) to 755 Commented Apr 18, 2014 at 10:01
1

It seems you have directory permissions issues on your server. Please go to Configuration > Media> File system "admin/config/media/file-system " and change Temporary directory or leave empty and save configuration( test it by leave it empty ,system set it to default that it can use as temp directory).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.