dcat-admin
dcat-admin copied to clipboard
上传失败
- Laravel Version: #.#.# Laravel Framework 8.75.0
- PHP Version: #.#.# php 7.3
- Dcat Admin Version: #.#.# v2.1.5-beta
Description:
上传所需要的配置都没有问题,因为前两个可以正常上传图片(如截图),但是前两个如果上传成功,删除了重新上传,就会报: POST http://abc.wjnew.net/admin/app 400 (Bad Request)
第三个(apk包)上传的时候,会报错,chrome 调试工具给的提示是(以下的内容每次都不完全一样,但是总量就这三种): Failed to load resource: net::ERR_CONNECTION_RESET Failed to load resource: the server responsed with a status of 400 (Bad Request) Failed to load resource: the server responsed with a status of 400 (Bad Request) Failed to load resource: the server responsed with a status of 400 (Bad Request) Failed to load resource: the server responsed with a status of 400 (Bad Request) Failed to load resource: net::ERR_CONNECTION_REFUSED Failed to load resource: the server responsed with a status of 400 (Bad Request) Failed to load resource: the server responsed with a status of 400 (Bad Request)
相应代码:
$form->file('apk_url') ->autoUpload() ->uniqueName() // ->accept('apk') ->move('app/apk') ->chunkSize(2048) ->threads(10) ->maxSize(102400000) ->required();
诡异现象:
上传的时候,进度条有时会后退,比如:已经上传到81%, 进度条突然回退到49%
返回 400 状态码基本上就是写法上有问题了
返回 400 状态码基本上就是写法上有问题了
这代码,在我们内网没问题,到了线上就有问题,而且线上和内网的环境一样,都是宝塔,包括php版本,apache版本,mysql 版本都一致。
发现去掉 ->threads(10) 貌似就不会出现诡异现象了。
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.