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

调用OssClient->putObject方法,如果$object中含有百分号就会出问题 #40

Closed
klom303 opened this issue Apr 20, 2017 · 2 comments

Comments

@klom303
Copy link

klom303 commented Apr 20, 2017

调用OssClient->putObject方法,
如果$object中含有百分号就会抛出一个空的异常,内容如下
“: RequestId:”

测试参数
putObject($config, 'test/%.txt', 'test content');

从源码中获取了下response

body:

    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">\r\n
    <html>\r\n
    <head><title>400 Bad Request</title></head>\r\n
    <body bgcolor="white">\r\n
    <h1>400 Bad Request</h1>\r\n
    <p>Your browser sent a request that this server could not understand.<hr/>Powered by AliyunOSS</body>\r\n
    </html>\r\n

@ljbreak2008
Copy link
Contributor

ljbreak2008 commented Dec 19, 2017

您好,上传时名称如遇到特殊字符需要先使用urlencode转译
example:

$object = '%.txt';

$urlencodeObject = urlencode($object);

$ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint);

$ossClient->putObject($bucket, $urlencodeObject, 'test content');

@huiguangjun
Copy link
Contributor

fix in af38fe3

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

3 participants