Magento 2 wysiwyg upload error {file} was not uploaded. File validation failed.

🛒 B-Online Store

Premium Magento 2 Extensions & Services

Enhance your e-commerce store with high-quality extensions and expert Magento development services. Trusted by thousands of merchants worldwide!

💬 WhatsApp Button ⚡ Flash Sale 🏷️ Product Labels 🌐 Translation Suite
🔥 UP TO 71% OFF Limited Time!
⭐ Thousands of Merchants 🛡️ Quality Guaranteed ⚡ Instant Download


The cause of this error in Magento 2 is missing php extension imagick or fileinfo both should be installed on the server

you can check if they are installed by creating new file in your Magento 2 root directory/pub you can name it info.php

and add this to the file

<?php
  phpinfo();

and access it from https://yourdomain.com/info.php

if you can’t find these extensions here

you have to install them

use these commands in your server to install them change php8.3 to your php running version these commands works in ubuntu OS

sudo apt update
sudo apt install php-imagick
sudo apt install php8.3-fileinfo