When I import produt image with .jpg then working correct. But when I upload .jpeg then return Disallowed File Type. when upload product image
Can anyone help how to change I can upload .jpeg?
can you please check that the PHP module fileinfo is enabled on your environment? usually that's the issue.
LE: also check this older post with a more detailed answer and other possible issues that can cause this. The fileinfo is also mentioned there as a cause of the problem.
Please check and let us know if you managed to solve this.
extension=fileinfo.so
. if there is a ;
in front of it, it means it is disabled and you need to remove it, restart php and recheck your image upload.
**
While creating a product in Magento 2, the admin uploads product images to display on the frontend. Furthermore, the admin replaces the product images as and when required.
However, some Magento 2 store owners face a "Disallowed File Type" error during the product image upload or replacement process. Usually, the error appears when the wrong image file is uploaded. But sometimes, the "disallowed file type" error in Magento 2 appears even when the image file type is correct.
Thus, you can follow the below solution to fix the "Disallowed File Type" error when uploading a product image,
vendor/magento/framework/File/
return $this->fileMime->getMimeType($this->_file['tmp_name']);
With:
return $this->_file['type'];
Hence, the steps mentioned above will help you to fix the "Disallowed File Type" error. However, If the issue persists, you can follow the below solution,
Thus, I hope the above solution helps you to fix the "Disallowed File Type" error when uploading a product image in Magento 2.
Regards,
Rex Maughan