Skip to content

Commit

Permalink
Improve file uploading code
Browse files Browse the repository at this point in the history
  • Loading branch information
Usbac committed Sep 30, 2024
1 parent 40628bc commit 2432456
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions app/bootstrap/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -614,14 +614,10 @@
}
}

try {
foreach ($files as $file) {
if (!\Aurora\App\Media::uploadFile($file, $path)) {
$success = false;
}
foreach ($files as $file) {
if (!\Aurora\App\Media::uploadFile($file, $path)) {
$success = false;
}
} catch (Exception $e) {
$success = false;
}

return json_encode([
Expand Down
2 changes: 1 addition & 1 deletion app/languages/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
'error_remove_some_items' => 'Not all items could be removed.',
'error_rename_item' => 'Error renaming item. The name is invalid, the file does not comply with the server rules or the path is not writable.',
'error_sending_email' => 'Error sending email. Verify the server configuration or contact an administrator',
'error_upload_file' => 'Error uploading file. The name is invalid, the size excees the <a href="/admin/settings#info">server rules</a> or the path is not writable.',
'error_upload_file' => 'Error uploading file(s). The name is invalid, the size excees the <a href="/admin/settings#info">server rules</a> or the path is not writable.',
'file_size_upload_limit' => 'File size upload limit',
'file_size_upload_limit_description' => 'The value is the lowest possible value between the <code>post_max_size</code> and the <code>upload_max_filesize</code> options of your PHP configuration.',
'folder' => 'Folder',
Expand Down
2 changes: 1 addition & 1 deletion app/languages/es.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
'error_remove_some_items' => 'No se pudieron eliminar todos los elementos.',
'error_rename_item' => 'Error al renombrar el elemento. El nombre es inválido, el archivo no cumple con las reglas del servidor o no tiene permisos de escritura en esa ruta.',
'error_sending_email' => 'Error al enviar el correo. Verifica la configuración del servidor o contacta con un administrador',
'error_upload_file' => 'Error al subir el archivo. El nombre es inválido, el tamaño excede las <a href="/admin/settings#info">reglas del servidor</a> o no tiene permisos de escritura en esa ruta.',
'error_upload_file' => 'Error al subir archivo(s). El nombre es inválido, el tamaño excede las <a href="/admin/settings#info">reglas del servidor</a> o no tiene permisos de escritura en esa ruta.',
'file_size_upload_limit' => 'Tamaño máximo de subida de archivos',
'file_size_upload_limit_description' => 'El valor es el valor mínimo entre las opciones de <code>post_max_size</code> y <code>upload_max_filesize</code> de tu configuración de PHP.',
'folder' => 'Carpeta',
Expand Down

0 comments on commit 2432456

Please sign in to comment.