Catalog image uploader
Definition at line 11 of file ImageUploader.php.
◆ __construct()
ImageUploader constructor
- Parameters
-
\Magento\MediaStorage\Helper\File\Storage\Database | $coreFileStorageDatabase | |
\Magento\Framework\Filesystem | $filesystem | |
\Magento\MediaStorage\Model\File\UploaderFactory | $uploaderFactory | |
\Magento\Store\Model\StoreManagerInterface | $storeManager | |
\Psr\Log\LoggerInterface | $logger | |
string | $baseTmpPath | |
string | $basePath | |
| string[] | $allowedExtensions |
Definition at line 91 of file ImageUploader.php.
103 $this->uploaderFactory = $uploaderFactory;
◆ getAllowedExtensions()
◆ getBasePath()
◆ getBaseTmpPath()
◆ getFilePath()
getFilePath |
( |
|
$path, |
|
|
|
$imageName |
|
) |
| |
Retrieve path
- Parameters
-
string | $path | |
string | $imageName | |
- Returns
- string
Definition at line 185 of file ImageUploader.php.
187 return rtrim(
$path,
'/') .
'/' . ltrim($imageName,
'/');
◆ moveFileFromTmp()
moveFileFromTmp |
( |
|
$imageName | ) |
|
Checking file for moving and move it
- Parameters
-
- Returns
- string
- Exceptions
-
Definition at line 199 of file ImageUploader.php.
208 $this->coreFileStorageDatabase->copyFile(
212 $this->mediaDirectory->renameFile(
216 }
catch (\Exception $e) {
217 throw new \Magento\Framework\Exception\LocalizedException(
218 __(
'Something went wrong while saving the file(s).')
getFilePath($path, $imageName)
◆ setAllowedExtensions()
setAllowedExtensions |
( |
|
$allowedExtensions | ) |
|
Set allowed extensions
- Parameters
-
string[] | $allowedExtensions |
- Returns
- void
Definition at line 142 of file ImageUploader.php.
◆ setBasePath()
◆ setBaseTmpPath()
setBaseTmpPath |
( |
|
$baseTmpPath | ) |
|
◆ $allowedExtensions
◆ $basePath
◆ $baseTmpPath
◆ $coreFileStorageDatabase
◆ $logger
◆ $mediaDirectory
◆ $storeManager
The documentation for this class was generated from the following file: