@include('work.common.header')
<form action="{url('api/up_upyun')}" enctype="multipart/form-data" method="POST" role="form">
<legend>上传图片</legend>
{csrf_field()}
<div class="form-group">
<label for="">label</label>
<input type="file" class="form-control" id="" name="file_data">
</div>
<div class="form-group">
<input type="submit" class="form-control" id="" value="上传图片">
</div>
</form>
// 上传到upanyun
function up_upyun(Request $request)
{
return Storage::disk('upyun')->put('/', $request->file('file_data'));
}
Client error: PUT http://v0.api.upyun.com/hezuopingtai/
resulted in a 403 Forbidden
response:
{"msg":"path is not a file, maybe a directory","code":40300015,"id":"6ee88706e6e5424c7ef4b7a2d8059f49"}