@@ -13,13 +13,13 @@ |
||
13 | 13 | |
14 | 14 | class File extends _Service |
15 | 15 | { |
16 | - public function moveUploadedFile($directory,$fileName, UploadedFile $uploadedFile) |
|
17 | - { |
|
18 | - $extension = pathinfo($uploadedFile->getClientFilename(), PATHINFO_EXTENSION); |
|
19 | - $basename = bin2hex(random_bytes(8)); // see http://php.net/manual/en/function.random-bytes.php |
|
20 | - $filename = sprintf('%s.%0.8s', $fileName, $extension); |
|
21 | - $uploadedFile->moveTo($directory . DIRECTORY_SEPARATOR . $filename); |
|
22 | - return $filename; |
|
23 | - } |
|
16 | + public function moveUploadedFile($directory,$fileName, UploadedFile $uploadedFile) |
|
17 | + { |
|
18 | + $extension = pathinfo($uploadedFile->getClientFilename(), PATHINFO_EXTENSION); |
|
19 | + $basename = bin2hex(random_bytes(8)); // see http://php.net/manual/en/function.random-bytes.php |
|
20 | + $filename = sprintf('%s.%0.8s', $fileName, $extension); |
|
21 | + $uploadedFile->moveTo($directory . DIRECTORY_SEPARATOR . $filename); |
|
22 | + return $filename; |
|
23 | + } |
|
24 | 24 | |
25 | 25 | } |
26 | 26 | \ No newline at end of file |