Press ESC to close

Error: main.CRITICAL: Invalid parameter is given. A valid $fileId[tmp_name] is expected in Magento 2

Have you ever faced the above-mentioned issue in your local development area? If yes, then we have a solution for you.

Note: This is a temporary solution we don’t recommend changing the core files.

Go to ‘vendor/Magento/Framework/File/Uploader.php’

In function ‘_setUploadField($field)’, comment out ‘$this->validateFileId($field)’ after doing this your function should be simile to the following image.

vendor/Magento/Framework/File/Uploader.php

Line numbers in the above screenshot may vary based on your Magento version.

Let us know if this solution helped you or not by commenting on our blog

Happy coding 🙂

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

Leave a Reply

Your email address will not be published. Required fields are marked *