Przeglądaj źródła

文件上传错误信息返回

jqh 5 lat temu
rodzic
commit
b706a110fc
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      src/Form/Field/UploadField.php

+ 4 - 0
src/Form/Field/UploadField.php

@@ -342,6 +342,10 @@ trait UploadField
     {
         $rules = $attributes = [];
 
+        if ($errors = $file->getErrorMessage()) {
+            return $errors;
+        }
+
         if (! $fieldRules = $this->getRules()) {
             return false;
         }