after update to new version 1.9.3. the Uploader is not working anymore. given below error.i upldate my code but still the same.

var uploader = new

Uploader({"uploaderConfig":{"chunkSize":1073741824,"withCrede...

below is my code

class Spacename_Modulename_Block_Adminhtml_Modulename_Edit_Tab_Images extends Mage_Adminhtml_Block_Widget {

    protected $_uploaderType = 'uploader/multiple';

    protected function _prepareForm() {
        $data = $this->getRequest()->getPost();
        $form = new Varien_Data_Form();
        $form->setValues($data);
        $this->setForm($form);

        return parent::_prepareForm();
    }

    protected function _prepareLayout() {
        $this->setChild('uploader', $this->getLayout()->createBlock($this->_uploaderType)
        );

        $this->getUploader()->getUploaderConfig()
                ->setFileParameterName('image')
                ->setTarget(Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('*/*/image'));

        $browseConfig = $this->getUploader()->getButtonConfig();
        $browseConfig
                ->setAttributes(array(
                    'accept' => $browseConfig->getMimeTypesByExtensions('gif, png, jpeg, jpg')
        ));


        return parent::_prepareLayout();
    }

}

js code

<script type="text/javascript">
//<![CDATA[
var <?php echo $_block->getJsObjectName(); ?> = new Product.Gallery('<?php echo $_block->getHtmlId() ?>', <?php echo $_block->getImageTypesJson() ?>);
//]]>
</script>
up vote 21 down vote accepted

After lot of searching i found that magento 1.9.3.0 they remove the flash uploader so js file need to run uploader add these file in head

<reference name="head">
            <action method="addJs"><file>lib/uploader/flow.min.js</file></action>
            <action method="addJs"><file>lib/uploader/fusty-flow.js</file></action>
            <action method="addJs"><file>lib/uploader/fusty-flow-factory.js</file></action>
            <action method="addJs"><file>mage/adminhtml/uploader/instance.js</file></action>
</reference>
  • 1
    How to upvote 5 times? – Arvind07 Mar 29 '17 at 8:35
  • @Arvind07 find 5 answer and upvote :D – Qaisar Satti Mar 29 '17 at 8:45
  • 1
    I have found this answer 5 times till now. It always saves me :) – Arvind07 Mar 29 '17 at 8:58
  • @QaisarSatti I am new in Magento and working to fix the same issue, in the console its showing me the error MediabrowserInstance is not defined magento. I don't know from where I can add the files in the head and also did not find these files in the folder structure. Can you please help me in this – Anshul Mishra Jul 19 '17 at 12:59
  • @AnshulMishra check this solution also magento.stackexchange.com/questions/142006/… – Qaisar Satti Jul 19 '17 at 13:03

I solved this problem by adjusting the file permissions.

Problem was that the above mentioned (new) Javascript files could not be loaded. A 403 error code has been thrown.

After setting file permissions on the directories

js/image/adminhtml/uploader

and

js/lib/uploader,

the upload button works correctly again!

  • This folder too: "js/mage/adminhtml/*" – artur Oct 4 '17 at 7:52

Whereabouts are we supposed to add:

<reference name="head">
            <action method="addJs"><file>lib/uploader/flow.min.js</file></action>
            <action method="addJs"><file>lib/uploader/fusty-flow.js</file></action>
            <action method="addJs"><file>lib/uploader/fusty-flow-factory.js</file></action>
            <action method="addJs"><file>mage/adminhtml/uploader/instance.js</file></action>
</reference>

I'm not sure what you mean by head

  • this is supposed to add current extension page head area. – Qaisar Satti Oct 11 '17 at 9:42

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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