diff --git a/FileInput.php b/FileInput.php index a5bf6ab..ff1aa56 100644 --- a/FileInput.php +++ b/FileInput.php @@ -86,6 +86,9 @@ public function init() if ($this->pluginLoading) { Html::addCssClass($this->options, 'file-loading'); } + if (!isset($this->field->form->options['enctype'])) { + $this->field->form->options['enctype'] = 'multipart/form-data'; + } $input = $this->getInput('fileInput'); $script = 'document.getElementById("' . $this->options['id'] . '").className.replace(/\bfile-loading\b/,"");'; if ($this->showMessage) {