my ($invocant, $filename) = @_;
$filename = clean_text($filename);
- $filename || ThrowUserError('file_not_specified');
+ if (!$filename) {
+ if (ref $invocant) {
+ ThrowUserError('filename_not_specified');
+ }
+ else {
+ ThrowUserError('file_not_specified');
+ }
+ }
# Remove path info (if any) from the file name. The browser should do this
# for us, but some are buggy. This may not work on Mac file names and could
[% title = "No File Specified" %]
You did not specify a file to attach.
+ [% ELSIF error == "filename_not_specified" %]
+ [% title = "No Filename Specified" %]
+ You must specify a filename for this attachment.
+
[% ELSIF error == "file_too_large" %]
[% title = "File Too Large" %]
[%# Convert maxlocalattachment from Mb to Kb %]