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>
Qaisar Satti
  • 32,469
  • 18
  • 85
  • 137

3 Answers3

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>
Qaisar Satti
  • 32,469
  • 18
  • 85
  • 137
  • 1
    How to upvote 5 times? – Arvind07 Mar 29 '17 at 08:35
  • @Arvind07 find 5 answer and upvote :D – Qaisar Satti Mar 29 '17 at 08:45
  • 1
    I have found this answer 5 times till now. It always saves me :) – Arvind07 Mar 29 '17 at 08: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 https://magento.stackexchange.com/questions/142006/issue-in-admin-panel-after-supee-patch-8788-installation?noredirect=1&lq=1 – Qaisar Satti Jul 19 '17 at 13:03
  • Thanks for the reply, but actually its very far from my knowledge. I have open the magento first time in my life today. And I am facing the issue in the cms > static block > insert image. While click on this insert image a pop up has opened and just show the directory structure at the left nothing else. And throw the error in console "MediabrowserInstance is not defined magento" – Anshul Mishra Jul 19 '17 at 13:17
  • @AnshulMishra this is not concern with these solution you have to google like these https://www.google.com.pk/search?q=magento+wysiwyg+editor+not+showing+images%5C&rlz=1C1CHBD_enPK737PK737&oq=magento+wysiwyg+editor+not+showing+images%5C&aqs=chrome..69i57j0j69i64l2.14649j0j7&sourceid=chrome&ie=UTF-8#q=magento+wysiwyg+editor+not+showing+images – Qaisar Satti Jul 19 '17 at 17:47
  • You save my day . Thanks a lot – Alex Sep 03 '20 at 18:53
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!

Teja Bhagavan Kollepara
  • 3,816
  • 5
  • 32
  • 69
artur
  • 11
  • 3
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

Fred
  • 31
  • 1
  • 3