diff --git a/app/code/Magento/Customer/Model/Metadata/Form/Image.php b/app/code/Magento/Customer/Model/Metadata/Form/Image.php index e4c79b8bccfe5..4311f7c49836a 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/Image.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/Image.php @@ -1,7 +1,7 @@ <?php /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. + * Copyright 2014 Adobe + * All Rights Reserved. */ declare(strict_types=1); @@ -139,9 +139,14 @@ protected function _validateByRules($value) $label = $value['name']; $rules = $this->getAttribute()->getValidationRules(); + $temporaryFile = $value['tmp_name']; + if (!$this->ioFileSystem->fileExists($temporaryFile)) { + $temporaryFile = $this->mediaEntityTmpReadDirectory->getAbsolutePath($temporaryFile); + } + try { // phpcs:ignore Magento2.Functions.DiscouragedFunction - $imageProp = getimagesize($value['tmp_name']); + $imageProp = getimagesize($temporaryFile); } catch (\Throwable $e) { $imageProp = false; }