/** * {@inheritDoc} */ public function setUseUploadName($flag = null) { if (null === $flag) { $this->options['use_upload_name'] = $flag; } else { parent::setUseUploadName($flag); } return $this; }
/** * * @param array $fileInfo * @param string $targetPath * OPTIONAL target directory (realpath) * @param boolean $overwrite * OPTIONAL whether or not to replace existing * @return array */ public function createFile(array $fileInfo, $targetPath = null, $overwrite = false) { $it = $this->getStorage(); if (empty($targetPath) || !is_dir($targetPath)) { $targetPath = $it->getRealPath(); } $filter = new RenameUpload($targetPath); $filter->setOverwrite($overwrite); $filter->setUseUploadName(true); return $filter->filter($fileInfo); }