讨论 使用交流 上传图片后报错

上传图片后报错

wangxiaoming1 发表于    阅读:434    回复:5

问题描述:

请详细描述问题

环境信息:

php8.1.2

windows下用的phpenv环境进行的安装。

复现步骤:

1,安装任意版本,然后JS就会报错


评论

可以查看下上传接口返回的数据是什么,查看下网络请求结果。

 

以下是返回的数据

<br />

<b>Notice</b>:  Unknown: file created in the system's temporary directory in <b>Unknown</b> on line <b>0</b><br />

{"code":0,"msg":"ok","data":{"chunks":1,"chunk":0,"file":{},"finished":true,"data":{"category":"image","path":"pogbu4xnqfejotabqt5aythv3hpepalc.jpg","filename":"553725a3f611e39a53aed89507210c98.jpg","size":"28564","md5":"1dcb20317e1089432fe110c4e90c2603","updated_at":"2023-03-08T09:32:56.000000Z","created_at":"2023-03-08T09:32:56.000000Z","id":17},"path":"data_temp\/image\/pogbu4xnqfejotabqt5aythv3hpepalc.jpg","preview":"\/data_temp\/image\/pogbu4xnqfejotabqt5aythv3hpepalc.jpg"}}


 

以下是请求的

{"code":0,"msg":"ok","data":{"lastModifiedDate":"Wed Aug 24 2022 16:04:55 GMT+0800 (\u4e2d\u56fd\u6807\u51c6\u65f6\u95f4)","md5":"1dcb20317e1089432fe110c4e90c2603","name":"553725a3f611e39a53aed89507210c98.jpg","size":"28564","type":"image\/jpeg","userId":1,"chunkUploaded":0,"hash":"b71e0bf173d0297c3fbc613938939819","path":"pogbu4xnqfejotabqt5aythv3hpepalc.jpg","fullPath":"data_temp\/image\/pogbu4xnqfejotabqt5aythv3hpepalc.jpg"}}

 

看应该是临时文件配置问题,检查下 php.ini 的变量 upload_tmp_dir

 

我发现这个问题了,谢谢。

 
1
我来评论
QQ
微信
客服