#65: Don't start uploading if no file was selected
This commit is contained in:
parent
4b7b99431f
commit
6040c7d4ef
|
@ -296,6 +296,12 @@ class PhotoController extends Controller
|
||||||
// Load the linked album
|
// Load the linked album
|
||||||
$album = $this->loadAlbum($request->get('album_id'));
|
$album = $this->loadAlbum($request->get('album_id'));
|
||||||
|
|
||||||
|
if (is_null($request->files->get('archive')))
|
||||||
|
{
|
||||||
|
$request->session()->flash('error', trans('admin.upload_bulk_no_file'));
|
||||||
|
return redirect(route('albums.show', ['id' => $album->id]));
|
||||||
|
}
|
||||||
|
|
||||||
$archiveFile = UploadedFile::createFromBase($request->files->get('archive'));
|
$archiveFile = UploadedFile::createFromBase($request->files->get('archive'));
|
||||||
if ($archiveFile->getError() != UPLOAD_ERR_OK)
|
if ($archiveFile->getError() != UPLOAD_ERR_OK)
|
||||||
{
|
{
|
||||||
|
|
|
@ -22923,6 +22923,13 @@ function UploadPhotosViewModel(album_id, queue_token, language, urls) {
|
||||||
// Get the selected files
|
// Get the selected files
|
||||||
var files = fileSelect[0].files;
|
var files = fileSelect[0].files;
|
||||||
|
|
||||||
|
if (files.length === 0)
|
||||||
|
{
|
||||||
|
alert(language.no_file_selected);
|
||||||
|
event.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Reset statistics
|
// Reset statistics
|
||||||
this.currentStatus = '';
|
this.currentStatus = '';
|
||||||
this.statusMessages = [];
|
this.statusMessages = [];
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -676,6 +676,13 @@ function UploadPhotosViewModel(album_id, queue_token, language, urls) {
|
||||||
// Get the selected files
|
// Get the selected files
|
||||||
var files = fileSelect[0].files;
|
var files = fileSelect[0].files;
|
||||||
|
|
||||||
|
if (files.length === 0)
|
||||||
|
{
|
||||||
|
alert(language.no_file_selected);
|
||||||
|
event.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Reset statistics
|
// Reset statistics
|
||||||
this.currentStatus = '';
|
this.currentStatus = '';
|
||||||
this.statusMessages = [];
|
this.statusMessages = [];
|
||||||
|
|
|
@ -258,6 +258,7 @@ return [
|
||||||
],
|
],
|
||||||
'title' => 'Gallery Admin',
|
'title' => 'Gallery Admin',
|
||||||
'upload_bulk_heading' => 'Upload a zip archive',
|
'upload_bulk_heading' => 'Upload a zip archive',
|
||||||
|
'upload_bulk_no_file' => 'No archive was uploaded. Please select a file to upload.',
|
||||||
'upload_bulk_text' => 'You can use the form below to upload a zip archive that contains your photographs. Any valid image files in the zip archive will be imported. Common hidden folders used by operating systems will be ignored.',
|
'upload_bulk_text' => 'You can use the form below to upload a zip archive that contains your photographs. Any valid image files in the zip archive will be imported. Common hidden folders used by operating systems will be ignored.',
|
||||||
'upload_bulk_text2' => 'Your web server is configured to allow files up to :max_upload_size to be uploaded.',
|
'upload_bulk_text2' => 'Your web server is configured to allow files up to :max_upload_size to be uploaded.',
|
||||||
'upload_disabled_heading' => 'Uploading is not supported on this system.',
|
'upload_disabled_heading' => 'Uploading is not supported on this system.',
|
||||||
|
@ -268,6 +269,7 @@ return [
|
||||||
'upload_file_status_failed' => ':file_name failed to upload',
|
'upload_file_status_failed' => ':file_name failed to upload',
|
||||||
'upload_file_status_progress' => ':current of :total files completed',
|
'upload_file_status_progress' => ':current of :total files completed',
|
||||||
'upload_file_status_success' => ':file_name uploaded successfully',
|
'upload_file_status_success' => ':file_name uploaded successfully',
|
||||||
|
'upload_no_file' => 'Please select a photo file to upload.',
|
||||||
'upload_single_file_heading' => 'Upload photos individually',
|
'upload_single_file_heading' => 'Upload photos individually',
|
||||||
'upload_single_file_text' => 'You can use the form below to upload individual files. To upload multiple files at once, hold down CTRL in the file browser.',
|
'upload_single_file_text' => 'You can use the form below to upload individual files. To upload multiple files at once, hold down CTRL in the file browser.',
|
||||||
'upload_single_file_text2' => 'Your web server is configured to allow files up to :file_size. If you browser does not support HTML 5 (most modern browsers do), the combined size of all selected files must be less than :max_upload_size.',
|
'upload_single_file_text2' => 'Your web server is configured to allow files up to :file_size. If you browser does not support HTML 5 (most modern browsers do), the combined size of all selected files must be less than :max_upload_size.',
|
||||||
|
|
|
@ -91,6 +91,7 @@
|
||||||
language.select_all_choice_visible_action = '{!! addslashes(trans('admin.select_all_choice.visible_action')) !!}';
|
language.select_all_choice_visible_action = '{!! addslashes(trans('admin.select_all_choice.visible_action')) !!}';
|
||||||
language.image_failed = '{!! addslashes(trans('admin.upload_file_status_failed')) !!}';
|
language.image_failed = '{!! addslashes(trans('admin.upload_file_status_failed')) !!}';
|
||||||
language.image_uploaded = '{!! addslashes(trans('admin.upload_file_status_success')) !!}';
|
language.image_uploaded = '{!! addslashes(trans('admin.upload_file_status_success')) !!}';
|
||||||
|
language.no_file_selected = '{!! addslashes(trans('admin.upload_no_file')) !!}';
|
||||||
language.replace_image_message = '{!! addslashes(trans('admin.replace_image_message')) !!}';
|
language.replace_image_message = '{!! addslashes(trans('admin.replace_image_message')) !!}';
|
||||||
language.replace_image_title = '{!! addslashes(trans('admin.replace_image_title')) !!}';
|
language.replace_image_title = '{!! addslashes(trans('admin.replace_image_title')) !!}';
|
||||||
language.upload_status = '{!! addslashes(trans('admin.upload_file_status_progress')) !!}';
|
language.upload_status = '{!! addslashes(trans('admin.upload_file_status_progress')) !!}';
|
||||||
|
|
Loading…
Reference in New Issue