1

I am unable to find any solution that will work for my issue so I need to post the question.

I recently upgraded to 1.9.3.3 and now the Browse button does nothing when clicked when trying to upload product images.

I also tried the Maven HTML5 uploader and it throws a Disallowed file type error (file type is a jpg).

Just not sure what do do next. Please help

1 Answer 1

1

Please check this post: Security Patch SUPEE-9767 - Possible issues?


For image upload errors read this:

Image Upload callback

The image gallery controller has been updated to add a validation callback.

What to do

If you're using a custom module that does image upload with code that looks like this:

    $uploader = new Mage_Core_Model_File_Uploader('image');
    $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
    $uploader->addValidateCallback('catalog_product_image',
        Mage::helper('catalog/image'), 'validateUploadFile');
    $uploader->setAllowRenameFiles(true);
    $uploader->setFilesDispersion(true);

I strongly suggest you update that code by adding the following piece after it:

    $uploader->addValidateCallback(
        Mage_Core_Model_File_Validator_Image::NAME,
        Mage::getModel('core/file_validator_image'),
        'validate'
    );
3
  • Hi sv3n. Before trying the Maven module I was attempting the basic out of the box product upload process. When it didn't work I tried the Maven module. However, I have since uninstalled it hoping to get the basic Magento uploader to work.
    – user49388
    Jun 17, 2017 at 2:19
  • @CamdenRoe could you solve it? If the Maven module has its own fileuploader search for it in code and add the lines posted above.
    – sv3n
    Aug 3, 2017 at 21:42
  • $uploader = new Maven_Html5uploader_Model_Media_Uploader(); $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png')); $uploader->setAllowRenameFiles(true); $uploader->setAllowCreateFolders(true); $uploader->setFilesDispersion(true);$uploader->addValidateCallback( Mage_Core_Model_File_Validator_Image::NAME, Mage::getModel('core/file_validator_image'), 'validate' ); $result = $uploader->save( Mage::getSingleton('catalog/product_media_config')->getBaseTmpMediaPath()); this my code aftter adding your answer but still not working
    – Melvin
    May 28, 2018 at 12:49

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.