fixes
This commit is contained in:
@@ -6,14 +6,15 @@
|
||||
/**
|
||||
* Generate a temporary file path.
|
||||
*
|
||||
* @return str The filtered array.
|
||||
* @param string $extension The file extension to use.
|
||||
* @return string The filtered array.
|
||||
*/
|
||||
function generateTempFilePath(): string
|
||||
function generateTempFilePath(string $extension = ''): string
|
||||
{
|
||||
$temporaryDir = storage_path('app/tmp');
|
||||
if (is_dir($temporaryDir) === false) {
|
||||
mkdir($temporaryDir, 0777, true);
|
||||
}
|
||||
|
||||
return $temporaryDir . DIRECTORY_SEPARATOR . uniqid('upload_', true);
|
||||
return $temporaryDir . DIRECTORY_SEPARATOR . uniqid('upload_', true) . ($extension !== '' ? ".{$extension}" : '');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user