Actually I'm refering to #19247 for PHP 7.2 specific issue.

that partially solved my issue but can't able to override that file.

I tried using preference here's what I tried. <preference for="Magento\Framework\File\Uploader" type="Vendor\Module\File\Uploader" />

But doesn't seems to work. Any idea ?


I strongly recommend to not use Preferences, because there are other techniques which you could use to update the input or output of a function.

For example you could write a Before plugin to update the incoming parameters or a After plugin to update the outgoing result.

But in your case it probably is not possible with a Plugin but then you could use the Composer Patch technique.

More information about Composer Patching in Magento 2 you can find here:



I write at medium a post how to Patch your Magento:


I also don't strongly recommend to not use Preferences same reason as Mr. Lewis.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.