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

PutObjectFromXX 时路径被加上了一层bucketName & CopyObject 时objName混乱 #21

Open
daaaabeen opened this issue May 24, 2019 · 0 comments

Comments

@daaaabeen
Copy link

daaaabeen commented May 24, 2019

问题1:

上传本地文件到bos上的 img/xxx.png

PutObjectFromFile("bucketName", "img/xxx.png", "{localpath}", putObjectArgs)

但是会被放到 /bucketName/img/.png下 最终的访问地址是

https://bucketName.bj.bcebos.com/bucketName/img/.png

预期得应该是 https://bucketName.bj.bcebos.com/img/.png 才对

也就是说 objName 用户给的是 "img/xxx.png" 而到了bos上就变成了 "bucketName/img/xxx.png"

问题2:

比如 我想要把刚刚上传的文件cp一下

// cp  /img/xxx.png to /img1/img.png
BasicCopyObject("bucketName", "/img1/img.png", "bucketName", "/img/xxx.png")

会报错 ** Code: NoSuchKey; Message: The specified key does not exist.; **

需要写成

// cp  bucketName/img/xxx.png to /img1/img.png
BasicCopyObject("bucketName", "/img1/img.png", "bucketName", "/bucketName/img/xxx.png")

才可以

这就名字有点混乱了 两边定义的参数都是objName,但是呢, 有的带 bucketName 前缀 有的又不带前缀

还有cp的参数顺序与常识不符,一般人会认为src在前 dest在后

@daaaabeen daaaabeen changed the title PutObjectFromXX PutObjectFromXX 时路径被加上了一层bucketName May 24, 2019
@daaaabeen daaaabeen changed the title PutObjectFromXX 时路径被加上了一层bucketName PutObjectFromXX 时路径被加上了一层bucketName & CopyObject 时objName混乱 May 24, 2019
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