0

I tried on the wysiwyg editor to upload zip files but it's not allowed. I created a folder where I uploaded a picture, and then I added manually some zip files inside. But when I open that folder in editor, I can't see my zip files, i can see only the picture.

It there any way to allow uploading a zip files?

2

2 Answers 2

0

Copy the file app/code/core/Mage/Cms/etc/config.xml to a custom module (do not change the core file). It defines the filetypes that can be uploaded.

Here you'll find:

 <adminhtml>
<cms>
  <browser>
    <extensions>
      <allowed>
        <jpg>1</jpg>
        <jpeg>1</jpeg>
        <png>1</png>
        <gif>1</gif>
        <pdf>1</pdf>
      </allowed>
    </extensions>
  </browser>
</cms>

There you can add the extensions you'd like to support:

<zip>1</zip>
<rar>1</rar>

Flush the cache, and try again.

5
  • so only copy the files in a etc folder form any module and will work? Jul 5, 2017 at 12:16
  • Yes, or copy the file from core to app/code/local/Mage/Cms/etc/config.xml and make the changes there.
    – Niels
    Jul 5, 2017 at 12:22
  • i did the same but not working that...! Sep 18, 2018 at 9:56
  • @Sarfaraj Where did you add this?
    – Niels
    Sep 18, 2018 at 10:41
  • @Niels, at this path added new file app/code/local/Mage/Cms/etc/config.xml . but i am working for .GIF image Sep 18, 2018 at 11:24
1

Create app/code/local/Mage/Cms/etc/config.xml and add the below code.


<?xml version="1.0"?>
<!--
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to [email protected] so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    Mage
 * @package     Mage_Cms
 * @copyright   Copyright (c) 2006-2017 X.commerce, Inc. and affiliates (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
-->
<config>
    <modules>
        <Mage_Cms>
            <version>1.6.0.0.2</version>
        </Mage_Cms>
    </modules>
    <frontend>
        <routers>
            <cms>
                <use>standard</use>
                <args>
                    <module>Mage_Cms</module>
                    <frontName>cms</frontName>
                </args>
            </cms>
        </routers>
        <events>
            <controller_action_noroute>
                <observers>
                    <cms>
                        <class>cms/observer</class>
                        <method>noRoute</method>
                    </cms>
                </observers>
            </controller_action_noroute>
            <controller_action_nocookies>
                <observers>
                    <cms>
                        <class>cms/observer</class>
                        <method>noCookies</method>
                    </cms>
                </observers>
            </controller_action_nocookies>
        </events>
        <translate>
            <modules>
                <Mage_Cms>
                    <files>
                        <default>Mage_Cms.csv</default>
                    </files>
                </Mage_Cms>
            </modules>
        </translate>
        <layout>
            <updates>
                <cms>
                    <file>cms.xml</file>
                </cms>
            </updates>
        </layout>
    </frontend>
    <adminhtml>
        <translate>
            <modules>
                <Mage_Cms>
                    <files>
                        <default>Mage_Cms.csv</default>
                    </files>
                </Mage_Cms>
            </modules>
        </translate>
        <layout>
            <updates>
                <cms>
                    <file>cms.xml</file>
                </cms>
            </updates>
        </layout>
        <cms>
            <browser>
                <dirs>
                    <exclude>
                        <!-- <catalog_dir regexp="0">catalog</catalog_dir> --><!-- use regexp="0" or "1" to override -->
                        <!-- downloadable>downloadable</downloadable>
                        <flex_dir>flex</flex_dir>
                        <import>import</import>
                        <tmp>tmp</tmp>
                        <js>js</js>
                        <css>css</css-->
                    </exclude>
                    <include/>
                </dirs>
                <extensions>
                    <allowed>
                        <jpg>1</jpg>
                        <jpeg>1</jpeg>
                        <png>1</png>
                        <gif>1</gif>
                        <zip>1</zip>
                        <rar>1</rar>
                    </allowed>
                    <image_allowed>
                        <jpg>1</jpg>
                        <jpeg>1</jpeg>
                        <png>1</png>
                        <gif>1</gif>
                    </image_allowed>
                    <media_allowed>
                        <flv>1</flv>
                        <swf>1</swf>
                        <avi>1</avi>
                        <mov>1</mov>
                        <rm>1</rm>
                        <wmv>1</wmv>
                    </media_allowed>
                </extensions>
                <window_width>1000</window_width>
                <window_height>600</window_height>
                <resize_width>100</resize_width>
                <resize_height>75</resize_height>
            </browser>
        </cms>
    </adminhtml>
    <global>
        <models>
            <cms>
                <class>Mage_Cms_Model</class>
                <resourceModel>cms_resource</resourceModel>
            </cms>
            <cms_resource>
                <class>Mage_Cms_Model_Resource</class>
                <deprecatedNode>cms_mysql4</deprecatedNode>
                <entities>
                    <page>
                        <table>cms_page</table>
                    </page>
                    <page_store>
                        <table>cms_page_store</table>
                    </page_store>
                    <block>
                        <table>cms_block</table>
                    </block>
                    <block_store>
                        <table>cms_block_store</table>
                    </block_store>
                </entities>
            </cms_resource>
        </models>
        <resources>
            <cms_setup>
                <setup>
                    <module>Mage_Cms</module>
                </setup>
            </cms_setup>
        </resources>
        <blocks>
            <cms>
                <class>Mage_Cms_Block</class>
            </cms>
        </blocks>
        <events>
            <controller_front_init_routers>
                <observers>
                    <cms>
                        <class>Mage_Cms_Controller_Router</class>
                        <method>initControllerRouters</method>
                    </cms>
                </observers>
            </controller_front_init_routers>
        </events>
        <cms>
            <page>
                <tempate_filter>cms/template_filter</tempate_filter>
            </page>
            <block>
                <tempate_filter>cms/template_filter</tempate_filter>
            </block>
        </cms>
    </global>
    <default>
        <web>
            <default>
                <cms_home_page>home</cms_home_page>
                <cms_no_route>no-route</cms_no_route>
                <cms_no_cookies>enable-cookies</cms_no_cookies>
                <front>cms</front>
                <no_route>cms/index/noRoute</no_route>
                <show_cms_breadcrumbs>1</show_cms_breadcrumbs>
            </default>
        </web>
        <cms>
            <wysiwyg>
                <enabled>enabled</enabled>
            </wysiwyg>
        </cms>
        <system>
            <media_storage_configuration>
                <allowed_resources>
                    <wysiwyg_image_folder>wysiwyg</wysiwyg_image_folder>
                </allowed_resources>
            </media_storage_configuration>
        </system>
    </default>
</config>

once added please clear cache and check it.

6
  • so i need an extesnion? because i see this <modules> <Prattski_WysiwygFiles> <version>1.0.0</version> </Prattski_WysiwygFiles> </modules> Jul 5, 2017 at 12:03
  • No Need, just create folder app/code/local/Mage/Cms/etc/ and add my code. Jul 5, 2017 at 12:05
  • Please try and let me know :) Jul 5, 2017 at 12:06
  • 2
    i added but no success Jul 5, 2017 at 12:07
  • i updated the code please check Jul 5, 2017 at 12:23

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.