Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RequestCoreException: cURL error: Empty reply from server (52) #265

Open
nilyang opened this issue Jun 12, 2023 · 0 comments
Open

RequestCoreException: cURL error: Empty reply from server (52) #265

nilyang opened this issue Jun 12, 2023 · 0 comments

Comments

@nilyang
Copy link

nilyang commented Jun 12, 2023

上传文件遇到问题:
'RequestCoreException: cURL error: Empty reply from server (52)'

原因分析:
上传图片之前,对图片进行了缩小,文件原大小为 26384 字节

缩略后,实际大小为 :14709 字节

问题代码:

\OSS\OssClient::uploadFile 计算文件大小之前,没有清理文件大小缓存,无法获得文件正确大小。

line: 1887  $file_size = sprintf('%u',filesize($options[self::OSS_FILE_UPLOAD]));

解决方法:

// 先清除文件状态
clearstatcache(true, $options[self::OSS_FILE_UPLOAD]);
// 再计算文件大小
$file_size = sprintf('%u',filesize($options[self::OSS_FILE_UPLOAD]));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant