芝麻web文件管理V1.00
编辑当前文件:/home/digitalh/panorama.panoramawholesale.com/app/Rules/CheckValidFile.php
allowFile = $allowFile; $this->checkMaxFileSize = $checkMaxFileSize; } /** * Determine if the validation rule passes. * * @param string $attribute * @param mixed $value * @return bool */ public function passes($attribute, $value) { $isValid = in_array($value->getClientOriginalExtension(), $this->allowFile) ? true : false; if ($isValid == false) { $this->errorMessage = __('Allowed File Extensions: ') . implode(', ', $this->allowFile); return false; } if ($this->checkMaxFileSize) { $maxFileSize = maxFileSize($_FILES[$attribute]['size']); if ($maxFileSize['status'] == 0) { $this->errorMessage = $maxFileSize['message']; return false; } } return true; } /** * Get the validation error message. * * @return string */ public function message() { return $this->errorMessage; } }