Magento

Magento CONNECT ERROR: Can’t write to file: downloader/.cache/community/

Magento Connect in Magento 1.5 sometimes throws the following error message on attempt to install some extension (we have noticed this on BusinessDecision_Interaktingslider):

CONNECT ERROR: Can't write to file: downloader/.cache/community/BusinessDecision_Interaktingslider-1.0.6/app/code/community/BusinessDecision/Interaktingslider/sql/interaktingslider_setup/mysql4-install-1.0.6.php
You have checked all permissions and sure that the destination is writeable, yet the Magento Connect cannot create this file.
The reason is that function working with archives passing non-ASCII characters in the filename and the filename cannot be created simply due to filesystem restrictions on filenames.
The simple fix can be just patch the _writeFile function indownloader/lib/Mage/Archive/Abstract.php to strip all non-ASCII characters from the filename:
--- Abstract.php
+++ downloader/lib/Mage/Archive/Abstract.php
@@ -43,4 +43,5 @@
     protected function _writeFile($destination, $data)
     {
+        $destination = preg_replace('/[^(\x20-\x7F)]*/','', $destination);
         if(false === file_put_contents($destination, $data)) {
             throw new Mage_Exception("Can't write to file: " . $destination);

Read More...