diff --git a/modules/backend/formwidgets/FileUpload.php b/modules/backend/formwidgets/FileUpload.php
index c488b9093..f6470830a 100644
--- a/modules/backend/formwidgets/FileUpload.php
+++ b/modules/backend/formwidgets/FileUpload.php
@@ -34,9 +34,9 @@ class FileUpload extends FormWidgetBase
//
/**
- * @var string Prompt to display if no record is selected.
+ * @var string Prompt text to display for the upload button.
*/
- public $prompt = 'backend::lang.fileupload.default_prompt';
+ public $prompt = null;
/**
* @var int Preview image width
@@ -126,7 +126,7 @@ class FileUpload extends FormWidgetBase
$this->vars['cssDimensions'] = $this->getCssDimensions();
$this->vars['cssBlockDimensions'] = $this->getCssDimensions('block');
$this->vars['useCaption'] = $this->useCaption;
- $this->vars['prompt'] = str_replace('%s', '', trans($this->prompt));
+ $this->vars['prompt'] = $this->getPromptText();
}
protected function getFileList()
@@ -166,6 +166,22 @@ class FileUpload extends FormWidgetBase
return $mode;
}
+ /**
+ * Returns the escaped and translated prompt text to display according to the type.
+ * @return string
+ */
+ protected function getPromptText()
+ {
+ if ($this->prompt === null) {
+ $isMulti = ends_with($this->getDisplayMode(), 'multi');
+ $this->prompt = $isMulti
+ ? 'backend::lang.fileupload.upload_file'
+ : 'backend::lang.fileupload.default_prompt';
+ }
+
+ return str_replace('%s', '', e(trans($this->prompt)));
+ }
+
/**
* Returns the CSS dimensions for the uploaded image,
* uses auto where no dimension is provided.
diff --git a/modules/backend/formwidgets/fileupload/partials/_file_multi.htm b/modules/backend/formwidgets/fileupload/partials/_file_multi.htm
index f4baf3050..6ae8c2d6b 100644
--- a/modules/backend/formwidgets/fileupload/partials/_file_multi.htm
+++ b/modules/backend/formwidgets/fileupload/partials/_file_multi.htm
@@ -11,8 +11,8 @@
>
-