首页 新闻 搜索 专区 学院

curl 以put形式发送文件,总是403错误AccessDenied禁止访问

0
悬赏园豆:100 [待解决问题]

这是返回的信息
< HTTP/1.1 100 Continue
send len=16

  • We are completely uploaded and fine
    < HTTP/1.1 403 Forbidden
    < Date: Wed, 26 Feb 2020 06:37:46 GMT
    < Content-Type: application/xml
    < Transfer-Encoding: chunked
    < Connection: keep-alive
    < Vary: Accept-Encoding
    < x-req-id: B63804D9239A43EA
    < x-amz-request-id: B63804D9239A43EA
    < Vary: Accept-Encoding
    < Server: jfe

<Error><statusCode>403</statusCode><Code>AccessDenied</Code><Message>Access Denied</Message><Resource>/sandboxcamera7/275489431/157675975283089560/20200226/14/1582699038552f57a1b98-e233-4f19-881a-dc545bb44581</Resource><RequestId>B63804D9239A43EA</RequestId></Error>

这是咋回事啊?
我发文件,我是fread函数传的
curl_easy_setopt(easy_handle, CURLOPT_READFUNCTION, &read_file); //调用重写的读文件流函数
curl_easy_setopt(easy_handle, CURLOPT_READDATA, r_file); //往read_file()函数中传入用户自定义的数据类型
curl_easy_setopt(easy_handle, CURLOPT_INFILE, r_file); //定位作为上传的输入文件

我是仿照这个写的https://blog.csdn.net/zengraoli/article/details/11580525
curl返回是0,没问题,但是http是403,我查了下,是我本地的问题,应该是curl那里忘记设置了,咋回事啊?
ssl我设置了,ca也验证成功了的

Frank_Tian的主页 Frank_Tian | 初学一级 | 园豆:102
提问于:2020-02-26 15:59

建议改进一下排版,支持 markdown 语法

dudu 5个月前
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册