Magento 2.3.2 File was not uploaded

The problem

Recently I fixed a bug relating to “file uploading” function. The situation:

  • Magento 2.3.2
  • PHP 7.2.20
  • Files permission is correct
  • The var/log/exception.log doesn’t show the error detail

The only clue that I have is the warning: File was not uploaded.

After check this Github issue, I figure out that the file’s “mime-type” may cause the problem.

The solution

My server was missing php_fileinfo extension, so I enabled it:

  1. Add extension=fileinfo.so to the end of file /etc/php.ini.
  2. Restart PHP FPM using this command: sudo service php-fpm restart.

 

Leave a Reply

avatar
  Subscribe  
Notify of