- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't upload images using WYSIWYG, as I get this error - File validation failed
My hosting provider has checked for permissions and they are fine.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I did the following
public_html/vendor/magento/framework/File/Uploader.php
Find and delete
return $this->fileMime->getMimeType($this->_file['tmp_name']);
Worked a treat
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: File validation failed
Hello @jm0452
are you uploading which type of files?
Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: File validation failed
I am uploading jpg files. It looks like its uploading but nothing appears in the folder
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: File validation failed
I am using Magento 2.2.5
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: File validation failed
Hello @jm0452,
That is an issue in Magento 2.2.5 version. Already created an issue for it https://github.com/magento/magento2/issues/16531
Please review it, might be you get an solution.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: File validation failed
src: https://github.com/magento/magento2/issues/16531/#issuecomment-404671271
Same problem here after updating to 2.2.5.
I was able to track my problem to Magento/Framework/File/Uploader.php:
private function _getMimeType() { return $this->fileMime->getMimeType($this->_file['tmp_name']); }
The temporary file name stored in $this->_file['tmp_name'] does not have an extension so Mime type returned will not be correct. I was able to solve my issue by going back and use return $this->_file['type'];
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: File validation failed
Same error in magento 2.2.6
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: File validation failed
i installed a demo with content in 2.2.6 and experienced the same issue, however, after installing "PHP Fileinfo module" it works, looks like that module is also required
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: File validation failed
Thanks for Sharing.. Really time saved after reading this..
@PaginasWebdotPE wrote:i installed a demo with content in 2.2.6 and experienced the same issue, however, after installing "PHP Fileinfo module" it works, looks like that module is also required