53 \
Magento\CatalogImportExport\Model\Import\UploaderFactory $uploaderFactory,
57 parent::__construct($context);
59 $this->fileUploader = $uploaderFactory->create();
60 $this->fileUploader->init();
62 $this->fileUploader->removeValidateCallback(
'catalog_product_image');
63 $this->connection =
$resource->getConnection(
'write');
83 $tmpPath = $dirAddon .
'/' . $this->mediaDirectory->getRelativePath(
'import');
86 if (!$this->fileUploader->setTmpDir($tmpPath)) {
87 throw new \Magento\Framework\Exception\LocalizedException(
88 __(
'File directory \'%1\' is not readable.', $tmpPath)
91 $destinationDir =
"downloadable/files/" .
$type;
92 $destinationPath = $dirAddon .
'/' . $this->mediaDirectory->getRelativePath($destinationDir);
94 $this->mediaDirectory->create($destinationPath);
95 if (!$this->fileUploader->setDestDir($destinationPath)) {
96 throw new \Magento\Framework\Exception\LocalizedException(
97 __(
'File directory \'%1\' is not writable.', $destinationPath)
111 foreach (array_keys($this->fileHelper->getAllMineTypes()) as
$option) {
const FIELD_NAME_IMG_FILE_DIR
static getDefaultConfig()
__construct(\Magento\Framework\App\Helper\Context $context, \Magento\Downloadable\Helper\File $fileHelper, \Magento\CatalogImportExport\Model\Import\UploaderFactory $uploaderFactory, \Magento\Framework\App\ResourceConnection $resource, \Magento\Framework\Filesystem $filesystem)
getUploader($type, $parameters)