private function saveFile()
    {
        $dirMedia = $this->filesystem->getDirectoryWrite(ADirList::MEDIA);
        $dirTarget = $dirMedia->getAbsolutePath(self::MEDIA_SUBFOLDER);
        $fileId = self::FIELDSET . '[' . self::FIELD_CSV_FILE . ']';
//        $fileId = self::FIELD_CSV_FILE;
//        $fileId = self::FIELDSET;
        $uploader = $this->factUploader->create(['fileId' => $fileId]);
        $uploader->setAllowRenameFiles(true);
        $result = $uploader->save($dirTarget);
        if (isset($result['path']) && isset($result['file'])) {
            $fullpath = $result['path'] . $result['file'];
            $this->logger->info("Uploaded file is saved into '$fullpath'.");
        }
        return $result;
    }
private function saveFile()
    {
        $dirMedia = $this->filesystem->getDirectoryWrite(ADirList::MEDIA);
        $dirTarget = $dirMedia->getAbsolutePath(self::MEDIA_SUBFOLDER);
        $fileId = self::FIELDSET . '[' . self::FIELD_CSV_FILE . ']';
//        $fileId = self::FIELD_CSV_FILE;
//        $fileId = self::FIELDSET;
        $uploader = $this->factUploader->create(['fileId' => $fileId]);
        $uploader->setAllowRenameFiles(true);
        $result = $uploader->save($dirTarget);
        if (isset($result['path']) && isset($result['file'])) {
            $fullpath = $result['path'] . $result['file'];
            $this->logger->info("Uploaded file is saved into '$fullpath'.");
        }
        return $result;
    }
private function saveFile ( ) { $ dirMedia = $ this -> filesystem -> getDirectoryWrite ( ADirList :: MEDIA ) ; $ dirTarget = $ dirMedia -> getAbsolutePath ( self :: MEDIA_SUBFOLDER ) ; $ fileId = self :: FIELDSET . '[' . self :: FIELD_CSV_FILE . ']' ; //        $fileId = self::FIELD_CSV_FILE; //        $fileId = self::FIELDSET; $ uploader = $ this -> factUploader -> create ( [ 'fileId' => $ fileId ] ) ; $ uploader -> setAllowRenameFiles ( true ) ; $ result = $ uploader -> save ( $ dirTarget ) ; if ( isset ( $ result [ 'path' ] ) && isset ( $ result [ 'file' ] ) ) { $ fullpath = $ result [ 'path' ] . $ result [ 'file' ] ; $ this -> logger -> info ( "Uploaded file is saved into '$fullpath'." ) ; } return $ result ; }
Save uploading file to the 'media' folder
@return array
@throws \Magento\Framework\Exception\FileSystemException
Save uploading file to the media folder