We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
目前我的写法是这样的,但是只支持单文件上传
public function wang_upload(Request $request){ if ($request->hasFile('wangEditorH5File') && $request->file('wangEditorH5File')->isValid()) { $file = $request->file('wangEditorH5File'); $save=array(); $result = '/storage/'.Storage::disk("admin")->putFile("editor", $file); $save[]=$result; echo json_encode(array('errno'=>0,'data'=>$save)); } else { echo json_encode(array('errno'=>1,'data'=>array(),'info'=>'no picture')); } }
The text was updated successfully, but these errors were encountered:
用$request->allFiles()获取所有上传文件对象
$request->allFiles()
Sorry, something went wrong.
可以了,谢谢,贴出了方便大家使用:
public function wang_upload(Request $request){ $save=array(); $all_file=$request->allFiles(); foreach ($all_file['wangEditorH5File'] as $key => $value) { if ($value->isValid()) { $result = '/storage/'.Storage::disk("admin")->putFile("editor", $value); $save[]=$result; } } echo json_encode(array('errno'=>0,'data'=>$save)); }
配置方法:
'wang-editor' => [ // 如果要关掉这个扩展,设置为false 'enable' => true, // 编辑器的配置 'config' => [ 'uploadImgServer' => '/api/wang_upload', 'uploadFileName' => 'wangEditorH5File[]' ] ],
No branches or pull requests
目前我的写法是这样的,但是只支持单文件上传
The text was updated successfully, but these errors were encountered: