Example #1
0
 private function uploadFile(File $file)
 {
     $file->setName($this->getUniqueFileName($file->getPath(), $file->getName()));
     if (!$this->fileSystem->writeStream($file->getUuid()->toString(), $file->getStream())) {
         throw new \RuntimeException('Failed to process uploaded file.');
     }
     $file->setStream($this->getFileStream($file->getUuid()));
 }