Solved – “Invalid parameter given. A valid $fileId[tmp_name] is expected” In Magento 2.3.3

Solved - "Invalid parameter given. A valid $fileId[tmp_name] is expected" In Magento 2.3.3

Ever faced an error that says “Invalid parameter given. A valid $fileId[tmp_name] is expected” In Magento 2.3.3?

I did.

And I found the solution for the same which I have shared with my readers in this post.

I was not able to upload a custom file in system configuration in local Magento 2.3.3. The issue was with the image uploader class of Magento core, due to which the below error was generated:

Solved - "Invalid parameter given. A valid $fileId[tmp_name] is expected" In Magento 2.3.3

Implement the below solution to get rid of the error.

Solution for the error “Invalid parameter given. A valid $fileId[tmp_name] is expected” In Magento 2.3.3:

Go to Magento\Framework\File\Uploader.php

In function _setUploadFileId($fileId), change:

to

That’s all for resolving the error.

Please use the Comments section below if you still face the error after implementing the above solution. Post your doubts and I’ll be there to help you out 🙂

Do not forget to share the solution with the Magento community via social media!

Thank you.

5
(based on 5 Reviews)

Sanjay is a co-founder at Meetanshi. He is a Certified Magento Developer who loves creating Magento E-commerce solutions. When he is not engrossed with anything related to Magento, he loves to play cricket.

Leave a Reply