Changed function generating names for uploaded files to the server.
This commit is contained in:
@@ -45,9 +45,13 @@ class FileService
|
||||
|
||||
public function getFileName(File $file): string
|
||||
{
|
||||
return 'ebook_' . $file->getBook()->getId() . '_' .
|
||||
md5($file->getFileName()) . '.' .
|
||||
$file->getExtension();
|
||||
return sprintf(
|
||||
'ebook_%d_%d_%s.%s',
|
||||
$file->getBook()->getId(),
|
||||
$file->getId(),
|
||||
md5($file->getFileName()),
|
||||
$file->getExtension()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user