我按照SDK文档简单测试上传:
$res = $oss->upload_file_by_file($bk,"aaa.pdf","vclua-0.5-qrf.pdf");
echo $res->body;
那个pdf文件已提前上传到脚本同一目录下。返回结果为:
ERROR
The requested URL could not be retrieved
Invalid Request error was encountered while trying to process the request:
PUT /sw99/aaa.pdf HTTP/1.1
Proxy-Authorization: Basic YWNlOmFjZTEyM3F3ZQ==
User-Agent: RequestCore/1.4.3
Accept: */*
Accept-Encoding: deflate, gzip
Referer: htt p : / / oss.aliyuncs.com/sw99/aaa.pdf
Proxy-Connection: Keep-Alive
Content-Type: application/pdf
Date: Tue, 05 May 2015 04:17:40 GMT
Host: oss.aliyuncs.com
Authorization: OSS xxxxx:xxxxxxx(已马赛克)
Content-Length: 270179
Expect: 100-continue
Some possible problems are:
Missing or unknown request method.
Missing URL.
Missing HTTP Identifier (HTTP/1.0).
Request is too large.
Content-Length missing for POST or PUT requests.
Illegal character in hostname; underscores are not allowed.
HTTP/1.1 "Expect:" feature is being asked from an HTTP/1.0 software.
Your cache administrator is root.
Generated Tue, 05 May 2015 04:17:40 GMT by localhost (squid/3.1.10)
HTTP status 为 417。
无论是 upload_file_by_file,还是upload_part,都返回同样的错误。请问这究竟是什么原因?
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。