Closed gwwnha closed 4 months ago
请问你上传的文件名后缀是那种类型的?
https://github.com/alipay/alipay-sdk-nodejs-all?tab=readme-ov-file#%E4%BD%BF%E7%94%A8-alipayformdata-%E8%A1%A8%E5%8D%95%E4%B8%8A%E4%BC%A0%E6%96%87%E4%BB%B6 @gwwnha 可以试试最新版本,走 curl 接口上传,我测试了一下支付宝 openapi v3 协议是不会出现这个问题的。
定位到了问题,需要 sdk 设置 content-length 在请求 header 里面。这个会在 alipay-sdk@4 版本修复。
调用alipaySdk.exec('alipay.open.file.upload', ....),没有经过nginx。
待上传文件大概150M左右,方法报错如下: AlipayRequestError: HTTP 请求错误, status: 413
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">\r\n' + '\r\n' + '
413 Request Entity Too Large
\r\n' + 'The requested resource does not allow request data with the requested method or the amount of data provided in the request exceeds the capacity limit. Sorry for the inconvenience.
\r\n' + '\r\n' + 'Please report this message and include the following information to us.
\r\n' + 'Thank you very much!
Powered by Tengine/2.1.0\r\n' + '\r\n