Commit 48e0c461 authored by zhuwei's avatar zhuwei

文件上传

parent d4b628d1
File added
......@@ -20,7 +20,7 @@ class UploadFileService
* @param array $ext
* @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
$path .= 'static/business_school/';
$internet_path = '';
break;
case 'business_school_file' :
$path .= 'static/business_school_file/';
$internet_path = '';
break;
default :
$data['code'] = 101;
$data['msg'] = "上传图片类型错误";
......@@ -158,6 +162,7 @@ class UploadFileService
}
$file_info = pathinfo($_upload_file['name']);
dump($file_info['extension']);
if (!in_array($file_info['extension'], $ext)) {
$data['code'] = 101;
$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