I try to upload a small (900 KB) .jpg image to my CMS Site, but I get File validation failed.

I made sure that I have all necessary permissions as stated in the magento documentation.

find . -type f -exec chmod 664 {} \;
find . -type d -exec chmod 775 {} \;
find var pub/static pub/media app/etc -type f -exec chmod g+w {} \;
find var pub/static pub/media app/etc -type d -exec chmod g+ws {} \;
chmod u+x bin/magento

But the error still appears. I am using Magento 2.3.2 with PHP Version 7.2.5

  • Try to upload another image, maybe image is corrupted. – Padhiyar Gaurang Dec 20 '19 at 8:41
  • @PadhiyarGaurang, I tried another image, same error. – Black Dec 20 '19 at 8:42
  • try with png, or other image from internet – Padhiyar Gaurang Dec 20 '19 at 8:43
  • @PadhiyarGaurang, I tried a .png image from the internet, same error – Black Dec 20 '19 at 8:45
  • Can you please check the var/log, you can find the hint fro there !!! – Dhrumin Dec 20 '19 at 8:47

The problem was caused by the missing PHP module "fileinfo".

I installed it with zypper in php7-fileinfo (open suse)

If you are using ubuntu then the package name might be different, probably php7.0-fileinfo

NOTE: Don't forget to restart the webserver after it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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