I am unable to upload images in magento admin panel , getting error "Destination folder is not writable or doen't exist". Recently moved all files from one hosting to another. Any solution for this?

  • What sort of hosting package do you have? If it includes support might be worth asking them about the current permissions. Jan 7, 2014 at 6:50
  • We have two websites hosted on same server and we have all permissions to upload a file and even though files are not uploading Jan 7, 2014 at 6:59

8 Answers 8


In your project open the file lib/Varien/File/Uploader.php and put a Mage::log() inside the save() function.

public function save($destinationFolder, $newFileName = null)

    if ($this->_allowCreateFolders) {

    if (!is_writable($destinationFolder)) {
        // Put a mage::log() and check what is the folder magento is looking for.
        throw new Exception('Destination folder is not writable or does not exists.');

From the log you can find out the folder which Magento is looking for. And then check permissions for that folder.

  • 5
    Thank you so much i forgetted to give file permission to Media/tmp/category/product, and after giving the file permission to that folder the problem has resolved Jan 7, 2014 at 7:20
  • 2
    Glad to hear your problem was solved. If this was helpful solve the issue please mark it as the answer.
    – Sukeshini
    Jan 7, 2014 at 7:24

Magento 2

I get the same error on Magento 2, and this is the file where the error come from in this case:


At line 256 you can temporarily place this code to get the unwritable/unexisting folder:

if( !is_writable($destinationFolder) ) {
    // throw new Exception('Destination folder is not writable or does not exists.');
    throw new Exception($destinationFolder);

Otherwise, check if these folders exists and that are writable by the web server:

  • pub/media/catalog/
  • pub/media/catalog/category
  • pub/media/catalog/product
  • pub/media/images
  • pub/media/wysiwyg/

For my the problem was solved by making


writable by the web server

The next folders under "pub/media" directory also are writables

- banners
- catalog
- images
- wysiwyg

For what its worth I've had this issue a few times and have forgotten that it's usually the image file itself, not the server after verifying permissions and all that. It still wouldn't upload the image because it was too large, either in dimensions or in filesize.

The solutions for me are to:


Make sure that the media folder media/tmp/catalog/product exist "and make that directory writable by your webserver"

  • Instead of setting the permission to 777, it's better to say "and make that directory writable by your webserver". The idea is that there is no need to give every single user write access just so that your webserver can write images. (I'm not the one who downvoted, but just in case you were wondering, this is most likely the reason why)
    – Dan
    Aug 25, 2015 at 13:48
  • yes of course ;)
    – Altravista
    Aug 26, 2015 at 13:34

Kindly check media folder having 777 permission.If you are enable the compilation mode means also check includes folder having 777 permission.

After giving 777 permission to those folders issue resolved for me.


It may be the expired certificate from the Plesk administration (it was my case).

I tried the steps above, but it did not work. From there I tried to access the files through FileZilla to give the permissions at once to all folders, hence an error message about the expired certificate. It is not the SSL certificate of the store itself, but the administration of Plesk. I created a new self-signed certificate, applied its Plesk administration and everything went back to normal.

This worked for me. I leave here my contribution.

Good luck


There is a bug in Magento for file upload when your magento DocumentRoot on vhost is properly set for


Instead of (deprecated)


Uploader tries to create files in


Note that location pub goes twice. They told they will fix it in 2.2.0+ but in 2.2.1 this problem still appear.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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