在workerman文檔里介紹[http://www.wtbis.cn/doc/workerman/http/request.html#獲取上傳文件]
$files = $request->file();
返回的文件格式類似:
array (
'avatar' => array (
'name' => '123.jpg',
'tmp_name' => '/tmp/workerman.upload.9hjR4w',
'size' => 1196127,
'error' => 0,
'type' => 'application/octet-stream',
)
)
可以返回這個(gè)信息,我主要想用的是size
因?yàn)椴煌瑫r(shí)候,上傳大小限制的maxsize不同,需要在這里做判斷
但是在 webman 里使用file(),得不到size
webman關(guān)于這塊的文檔里也沒(méi)有。
[http://www.wtbis.cn/doc/webman/request.html#獲取上傳文件]