5

I have an issue where I cannot add images to products on Magento 2.0.7. Attempts to do so with jpg, png, jpeg, and/or gif yield the following error:

Attention

We don't recognize or support this file extension type.

I have tried every file type known to man or woman. . Can anyone advise as to where this info is stored? The console in Chrome says nothing at all. The admin lists nothing.

Thanks to @krishna ijjada we can find this Javascript validation code at

/vendor/magento/module-catalog/view/adminhtml/web/catalog/base-image-uploader.js

acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i

My code matches this. I can find no other instance in any forum of this happening. Anyone else?

3 Answers 3

3

Magento 2 product image validates/accepts jpeg,.jpg,.png and gif image/file formats.

We can find this Javascript validation code at /vendor/magento/module-catalog/view/adminhtml/web/catalog/base-image-uploader.js

acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,

Unfortunately information (accepted types)is not provided.

Hope this helps.

6
  • Please check the modified answer. Jul 19, 2016 at 16:49
  • Can you provide a sample of what it should say?
    – Qozmiq
    Jul 19, 2016 at 17:07
  • Is anything in my code blocking this? acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, Seems correct.
    – Qozmiq
    Jul 19, 2016 at 17:13
  • Yes , it will accepts jpeg,.jpg,.png and gif only. Jul 19, 2016 at 18:02
  • Yes I understand what its asking for, its just when I provide a jpeg, jpg, png, and/or gif, it still tells me that its not an acceptable file type. That was the original post here. I'll edit for clarity.
    – Qozmiq
    Jul 20, 2016 at 3:10
0

The host accepted blame due to an PHP config issue.

0

Check phpinfo() page, if file_uploads is off, set file_uploads on

enter image description here

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.