Filename as original

This commit is contained in:
Peter Papp
2021-06-18 17:23:40 +02:00
parent 24676e2392
commit f6f9199b87
8 changed files with 23 additions and 8 deletions
@@ -1,4 +1,5 @@
<?php
namespace App\Http\Requests\FileFunctions;
use App\Rules\DisabledMimetypes;
@@ -24,8 +25,9 @@ class UploadRequest extends FormRequest
public function rules()
{
return [
'filename' => 'required|string',
'folder_id' => 'nullable|uuid',
'file' => ['required', 'file', new DisabledMimetypes],
'file' => ['required', 'file', new DisabledMimetypes],
];
}
}
+5 -1
View File
@@ -22,7 +22,11 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
$app_locale = get_setting('language') ?? 'en';
try {
$app_locale = get_setting('language') ?? 'en';
} catch (\PDOException $exception) {
$app_locale = 'en';
}
// Set locale for application
app()->setLocale($app_locale);
+1 -1
View File
@@ -402,7 +402,7 @@ class FileManagerService
'type' => get_file_type($file_mimetype),
'folder_id' => $request->folder_id,
'metadata' => $metadata,
'name' => $user_file_name,
'name' => $request->filename,
'basename' => $disk_file_name,
'author' => $shared ? 'visitor' : 'user',
'thumbnail' => $thumbnail,