Esempio n. 1
0
 private function allowedType(UploadedFile $uploadedFile)
 {
     return !$this->getAllowedMimeTypes() || in_array($uploadedFile->getMimeType(), $this->getAllowedMimeTypes());
 }
Esempio n. 2
0
 public static function createWithUploadedFile(UploadedFile $uploadedFile, $basePath, $baseUrl)
 {
     $uniqueIdentifier = time();
     return new static(['basePath' => $basePath, 'baseUrl' => $baseUrl, 'size' => $uploadedFile->getSize(), 'mimeType' => $uploadedFile->getMimeType(), 'filename' => $uniqueIdentifier . '.' . $uploadedFile->getExtension(), 'uniqueIdentifier' => $uniqueIdentifier]);
 }