fix(backup): handle PostTooLargeException gracefully and add client-side file size guard
This commit is contained in:
+5
-1
@@ -18,5 +18,9 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
]);
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions): void {
|
||||
//
|
||||
$exceptions->render(function (\Illuminate\Http\Exceptions\PostTooLargeException $e, $request) {
|
||||
$postMax = ini_get('post_max_size') ?: '256M';
|
||||
$uploadMax = ini_get('upload_max_filesize') ?: '256M';
|
||||
return back()->with('error', "Ukuran file yang Anda kirim terlalu besar dan melebihi batas konfigurasi server PHP (post_max_size: {$postMax}, upload_max_filesize: {$uploadMax}). Harap naikkan batas konfigurasi php.ini atau gunakan file yang lebih kecil.");
|
||||
});
|
||||
})->create();
|
||||
|
||||
Reference in New Issue
Block a user