1

I am trying to upload image in backend but i am getting below error in admin.

I am not handling to debug php code and only familiar with html/css + basics js and many modules are already installed in default system so don't know where the exactly the issue is might be fileuploader.php file.

enter image description here

So if anyone has idea about patch work or quick fix then it would be helpful.I am in windows system. I don't want to fix it in proper way but i need some patch so i can later revert that patch.|

I already tried deleting pub/media gave permission to them but it seems not an issue.

I have checked in console and got below

enter image description here

1 Answer 1

3

I have temporarily fixed it by changing in magento core Gd2.php file line no 96 by adding one more if condition

private function validateURLScheme(string $filename) : bool
    {
        $allowed_schemes = ['ftp', 'ftps', 'http', 'https'];
        $url = parse_url($filename);
        if ($url && isset($url['scheme']) && !in_array($url['scheme'], $allowed_schemes) && !file_exists($filename)) {
            return false;
        }

        return true;
    }

vendor\magento\framework\Image\Adapter\Gd2.php as suggested in this answer

Wrong file in vendor/magento/framework/Image/Adapter/Gd2.php:64 when i install magento 2.3

I don't know if it is proper way or not but at-least it works and now i am able to upload image in the backend in my windows system.

1
  • Thanks buddy worked for me :)
    – SA Soibal
    Aug 26, 2020 at 5:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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