8

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>

3 Answers 3

27

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>
8
  • 1
    How to upvote 5 times?
    – Arvind07
    Mar 29, 2017 at 8:35
  • @Arvind07 find 5 answer and upvote :D Mar 29, 2017 at 8:45
  • 1
    I have found this answer 5 times till now. It always saves me :)
    – Arvind07
    Mar 29, 2017 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 Jul 19, 2017 at 12:59
  • @AnshulMishra check this solution also magento.stackexchange.com/questions/142006/… Jul 19, 2017 at 13:03
1

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!

1
  • This folder too: "js/mage/adminhtml/*"
    – artur
    Oct 4, 2017 at 7:52
1

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

2
  • this is supposed to add current extension page head area. Oct 11, 2017 at 9:42
  • Can you please tell me where to add this code I am use custom theme in Magento 1.9.3.8 Version. Please give me file path. Jan 5, 2019 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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