Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 3 of 3
[Solved]Can’t read image folder after upgrate to 1.5.0.1
 
eddieb
Sr. Member
 
Avatar
Total Posts:  87
Joined:  2008-04-17
Rio de Janeiro, Brazil
 

Whats the update on this one? Is this fixed on 1.6.x or ???

 
Magento Community Magento Community
Magento Community
Magento Community
 
Vinagento
Jr. Member
 
Avatar
Total Posts:  20
Joined:  2010-02-25
 

Another solution i found is just delete .htaccess in your media folder

 
Magento Community Magento Community
Magento Community
Magento Community
 
eddieb
Sr. Member
 
Avatar
Total Posts:  87
Joined:  2008-04-17
Rio de Janeiro, Brazil
 
Vinagento - 22 March 2012 07:19 AM

Another solution i found is just delete .htaccess in your media folder

that could be dangerous, especially in a folder that needs 777 permissions. see this blog post for more details

 
Magento Community Magento Community
Magento Community
Magento Community
 
ereckers
Jr. Member
 
Total Posts:  11
Joined:  2008-10-23
San Francisco, CA
 

This just seems to me that Magento decided to change the upload path for the Media Manager/Uploader from:

media/

to:

media/wysiwyg

Which I don’t think is a bad idea. Makes sense that uploads from the WYSIWYG is sandboxed some way and not allowed just to dump anything it wants at media/ root. Kind of stinks that it doesn’t degrade gracefully, but I’m just going to stick with the wysiwyg directory and eventually cleanup media/ after about a year.

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1848
Joined:  2009-06-04
 

Removing the .htaccess in the media folder is an immediate security breach.

You’re giving a remote user the ability to upload into a globally readable and writable directory in which they can insert php scripts and run them.

One of the reasons for the .htaccess is to shut off executing php scripts.

Anyone doing it needs to have their web URL sent to SEA so hilarity can ensue.

 
Magento Community Magento Community
Magento Community
Magento Community
 
NELAGeek
Sr. Member
 
Avatar
Total Posts:  193
Joined:  2010-01-23
US
 

I had an image issue before as well. Figure out it was the ‘Options All’ in the .htaccess file.  My Apache setup doesn’t allow the use of that option.  So I just changed that line to ‘Options -Index’ and everything worked fine again.  Definitely wouldn’t remove the .htaccess file.

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1848
Joined:  2009-06-04
 

Exactly the point. All the other stuff in there that disables the php engine and removes CGI execution must remain intact in the media .htaccess file.

Options All -Indexes
<IfModule mod_php5.c>
php_flag engine 0
</IfModule>

AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
Options 
-ExecCGI

<IfModule mod_rewrite.c>

############################################
## enable rewrites

    
Options +FollowSymLinks
    RewriteEngine on

############################################
## never rewrite for existing files
    
RewriteCond %{REQUEST_FILENAME} !-f

############################################
## rewrite everything else to index.php

    
RewriteRule .* ../get.php [L]
</IfModule>

As to the issue on not seeing the folders, I created a module that overwrote the function

public function getDirsCollection($pathin Mage_Cms_Model_Wysiwyg_Images_Storage

which removed the table check. People who upgraded from earlier versions of 1.5.x.x probably had no issue if the final 1.5.1.0 upgrade did not remove the table.

/* this unused table was removed in 1.5.1.0 and causes subdirs to be invisible */
        //$subDirectories = Mage::getModel('core/file_storage_directory_database')->getSubdirectories($path);

        //foreach ($subDirectories as $directory) {
        //    $fullPath = rtrim($path, DS) . DS . $directory['name'];
        //    if (!file_exists($fullPath)) {
        //        mkdir($fullPath, 0777, true);
        //    }
        //}

Since we try to practice good file management technique as is highly necessary on large systems, we’d placed the CMS image library in media/images with subfolders for each function. It was a simple tar -czf wysimg.tgz in the old directory, move the archive and a tar -xzf wysimg.tgz to put them in the new folder.

the CMS system has to rebuild the thumbnails on first opening a directory, so large content folders take a while on initial access.

 
Magento Community Magento Community
Magento Community
Magento Community
 
pinkalllll
Jr. Member
 
Total Posts:  1
Joined:  2012-12-16
 

when insert image to Media Storage, then images are not showing and the program can’t read the Media folder any more, and always shows SQL data error.

Please Help me. question

Image Attachments
Untitled.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
Sindre|ProperHost
Mentor
 
Avatar
Total Posts:  1158
Joined:  2008-04-24
 

What is the SQL error you are getting? Check that the “media” folder is writable by the web server.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sindre|ProperHost
Mentor
 
Avatar
Total Posts:  1158
Joined:  2008-04-24
 
Monty22 - 04 October 2013 08:10 AM

Hi,

Just delete .htaccess in your media folder.

I am curious - why do you suggest this? The .htaccess file contains important directives to prevent unauthorized access, so removing that file is not something we would recommend.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 3 of 3