首页
下载
文档
社区
视频
捐赠
源代码
赞助商
AOT 编译器
AI 助理
商业产品
PHP AOT 原生编译器
Swoole-Compiler 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
上传图片,大文件异常
### 问题描述 上传文件4M的图片,然后出现异常。无回调 ### Swoole版本,PHP版本,以及操作系统版本信息 swoole4.4.16 php7.2 centos 7.4 X64 swoft2.x ### 相关代码 ```php 请将代码粘贴至此处(请勿用截图) ``` /** * @RequestMapping("/AppWarehouseOrder/adminLogisticsImage",method={RequestMethod::POST}) * @return Response */ public function adminLogisticsImage(){ $request = context()->getRequest(); $files = $request->getUploadedFiles(); if (!array_key_exists('file', $files)) { $res = Result(201, '图片信息为空', $files); return context()->getResponse()->withData($res); } $file = $files['file']; if ($file) { $res = Result(201, '图片信息为空!', $file); return context()->getResponse()->withData($res); } $Upload = new Upload(); $res = $Upload->LogisticsImageUpload($file); return context()->getResponse()->withData($res); } nginx 中错误~! 难道是没有权限? 2020/05/01 13:05:19 [error] 9547#0: *1 writev() failed (32: Broken pipe) while sending request to upstream, client: 113.68.8.227, server: admin.mdhfz.com, request: "POST /AppWarehouseOrder/adminLogisticsImage HTTP/1.1", upstream: "http://127.0.0.1:18306/AppWarehouseOrder/adminLogisticsImage", host: "admin.mdhfz.com" nginx 1.18.0 上传大一点的文件,图片 就404 ### 你期待的结果是什么?实际看到的错误信息又是什么?
发布于6年前 · 9 次浏览 · 来自
提问
中华锦鲤
### 问题描述 上传文件4M的图片,然后出现异常。无回调 ### Swoole版本,PHP版本,以及操作系统版本信息 swoole4.4.16 php7.2 centos 7.4 X64 swoft2.x ### 相关代码 ```php 请将代码粘贴至此处(请勿用截图) ``` /** * @RequestMapping("/AppWarehouseOrder/adminLogisticsImage",method={RequestMethod::POST}) * @return Response */ public function adminLogisticsImage(){ $request = context()->getRequest(); $files = $request->getUploadedFiles(); if (!array_key_exists('file', $files)) { $res = Result(201, '图片信息为空', $files); return context()->getResponse()->withData($res); } $file = $files['file']; if ($file) { $res = Result(201, '图片信息为空!', $file); return context()->getResponse()->withData($res); } $Upload = new Upload(); $res = $Upload->LogisticsImageUpload($file); return context()->getResponse()->withData($res); } nginx 中错误~! 难道是没有权限? 2020/05/01 13:05:19 [error] 9547#0: *1 writev() failed (32: Broken pipe) while sending request to upstream, client: 113.68.8.227, server: admin.mdhfz.com, request: "POST /AppWarehouseOrder/adminLogisticsImage HTTP/1.1", upstream: "http://127.0.0.1:18306/AppWarehouseOrder/adminLogisticsImage", host: "admin.mdhfz.com" nginx 1.18.0 上传大一点的文件,图片 就404 ### 你期待的结果是什么?实际看到的错误信息又是什么?
赞
0
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
登录
后参与评论
评论
2020-05-02
鲸落
如果时nginx的问题,可以查看下nginx的文件上传限制
赞
0
回复
2020-05-08
李铭昕
nginx 文件大小限制 swoole package_max_length 都改一下试试呢?
赞
0
回复
2020-05-12
中华锦鲤
回复
李铭昕
那里改swoole的限制
赞
0
回复
2020-05-12
鲁飞
回复
中华锦鲤
server.php
赞
0
回复