title: Magento. Destination folder is not writable or does not exists
body: <p>Hey I'm stuck with the following problem, plz help.</p>
  
  <p>I get <strong>"Destination folder is not writable.."</strong> when trying to add an image to a product, but the permission for all needed folders is <strong>777</strong>! I had deleted all files on server, didn`t touch DB, reinstalled Magento from scratch with new DB, and everything is OK. 
  But when I switched to previous DB (change settings in the <strong>local.xml</strong>) the bug appeared again.</p>
  
  <p>How can the DB impact the folder permissions?</p>
  
  <p>UPDATE:</p>
  
  <p>Thanx a lot, we found out that Magento jump from this method:</p>
  
  <pre><code>public function getBaseMediaUrl()
  {
     return Mage::getBaseUrl('media') . 'catalog/product';
  }
  </code></pre>
  
  <p>to the following method:</p>
  
  <pre><code>public function getBaseTmpMediaUrl()
  {
          return Mage::getBaseUrl('media') . 'tmp/catalog/product';
  }
  </code></pre>
  
  <p>Does anybody know why and how????</p>