How To Fix “Invalid parameter given. A valid $fileId[tmp_name] is expected” In Magento 2.4

Surely you have encountered many errors during using Magento 2. It makes you feel very uncomfortable. Share how to fix it helps you to fix it quickly and easily. In this post, I will guide you How To Fix “Invalid parameter given. A valid $fileId[tmp_name] is expected” In Magento 2.4.

I got this error in version 2.4 while loading images while configuring the system. The Uploader class in Magento’s core file had some issues that prevented it from being able to upload photos. I tried it a few times and then figured out how to fix it.

Invalid parameter given A valid $fileId[tmp_name] is expected

To fix it quite simply, you just need to edit the Uploader class in the Magento source file. Here, I will guide you step by step.

Steps To Fix “Invalid parameter given. A valid $fileId[tmp_name] is expected” In Magento 2.4

Step 1: Go to vendor\magento\framework\file in Magento 2 Root folder.

Here I am using localhost, for the server you still use this path to the File directory.

Step 2: Open Uploader.php.

Open Uploader php file

Please note that this is the source directory of Magento 2, to edit it you must grant administrator privileges.

Step 3: Scroll down to line 579.

Comment line 579

Replace

$this->validateFileId($fileId);

to

//$this->validateFileId($fileId);

Step 4: Save change.

You can read more useful articles like How To Change PDF Invoice Logo In Magento 2.

Follow us for the more helpful posts!

We hope this is a useful post for you.

Thank you for reading!

4.5 2 votes
Article Rating

Aaron LX

Aaron is a passionate writer, crazy about shopping, eCommerce and trends. Besides his outstanding research skills and a positive mind, Aaron eagerly shares his experience with the readers.

Leave a Reply or put your Question here

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x