diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt index a9bd956498..28fc6792ff 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt @@ -47,6 +47,7 @@
[% IF errors.empty_upload %]The file you are attempting to upload has no contents.[% END %] [% IF errors.no_file %]You did not select a file to upload.[% END %] + [% IF errors.upload_failed %]The upload failed. More information may be in the system logs.[% END %]
[% END %] diff --git a/members/files.pl b/members/files.pl index 2abfbc71de..b927140d8b 100755 --- a/members/files.pl +++ b/members/files.pl @@ -87,12 +87,13 @@ else { $file_content .= $_; } - $bf->AddFile( + my $rv = $bf->AddFile( name => $filename, type => $mimetype, content => $file_content, description => scalar $cgi->param('description'), ); + $errors{upload_failed} = 1 unless $rv; } } else { @@ -103,9 +104,7 @@ else { } $template->param( - files => Koha::Patron::Files->new( borrowernumber => $borrowernumber ) - ->GetFilesInfo(), - + files => Koha::Patron::Files->new( borrowernumber => $borrowernumber )->GetFilesInfo(), errors => \%errors, ); output_html_with_http_headers $cgi, $cookie, $template->output;