Commit 48e0c461 authored by zhuwei's avatar zhuwei

文件上传

parent d4b628d1
File added
...@@ -20,7 +20,7 @@ class UploadFileService ...@@ -20,7 +20,7 @@ class UploadFileService
* @param array $ext * @param array $ext
* @return array * @return array
*/ */
public function upload($_upload_file, $type, $size = 1000000, $ext = [ 'jpg','png','jpeg' ]) public function upload($_upload_file, $type, $size = 1000000, $ext = [ 'jpg','png','jpeg','xlsx'])
{ {
/** /**
* *
...@@ -74,6 +74,10 @@ class UploadFileService ...@@ -74,6 +74,10 @@ class UploadFileService
$path .= 'static/business_school/'; $path .= 'static/business_school/';
$internet_path = ''; $internet_path = '';
break; break;
case 'business_school_file' :
$path .= 'static/business_school_file/';
$internet_path = '';
break;
default : default :
$data['code'] = 101; $data['code'] = 101;
$data['msg'] = "上传图片类型错误"; $data['msg'] = "上传图片类型错误";
...@@ -158,6 +162,7 @@ class UploadFileService ...@@ -158,6 +162,7 @@ class UploadFileService
} }
$file_info = pathinfo($_upload_file['name']); $file_info = pathinfo($_upload_file['name']);
dump($file_info['extension']);
if (!in_array($file_info['extension'], $ext)) { if (!in_array($file_info['extension'], $ext)) {
$data['code'] = 101; $data['code'] = 101;
$data['msg'] = '文件类型不符无法上传'; $data['msg'] = '文件类型不符无法上传';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment