diff --git a/code/model/editableformfields/EditableFileField.php b/code/model/editableformfields/EditableFileField.php index 1a9d07e..f272925 100755 --- a/code/model/editableformfields/EditableFileField.php +++ b/code/model/editableformfields/EditableFileField.php @@ -93,7 +93,7 @@ class EditableFileField extends EditableFormField ); if ($this->MaxFileSizeMB > 0) { - $field->getValidator()->setAllowedMaxFileSize($this->MaxFileSizeMB * 1024); + $field->getValidator()->setAllowedMaxFileSize($this->MaxFileSizeMB * 1024 * 1024); } else { $field->getValidator()->setAllowedMaxFileSize(static::get_php_max_file_size()); } diff --git a/tests/EditableFileFieldTest.php b/tests/EditableFileFieldTest.php index 46537fb..ac18023 100644 --- a/tests/EditableFileFieldTest.php +++ b/tests/EditableFileFieldTest.php @@ -61,7 +61,7 @@ class EditableFileFieldTest extends SapphireTest $fileField->write(); $formField = $fileField->getFormField(); - $this->assertEquals($formField->getValidator()->getAllowedMaxFileSize(), 256); + $this->assertEquals($formField->getValidator()->getAllowedMaxFileSize(), 262144); } } \ No newline at end of file