Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
204 views
in Technique[技术] by (71.8m points)

Google Cloud Storage JSON REST API - Get object held in a sub-directory

I'm looking to access an object I have stored in Google Cloud Storage - this is straightforward enough if the object is stored at the highest level of the bucket using the following call as per the documentation:

https://storage.googleapis.com/storage/v1/b/bucketname/o/objectname?alt=media

However, if the file is held within a sub-directory on the bucket I'm unable to access it. There doesn't seem to be any guidance in the docs on this. I've tried the following calls but neither have been successful:

https://storage.googleapis.com/storage/v1/b/bucketname/o/foldername/objectname?alt=media https://storage.googleapis.com/storage/v1/b/bucketname/foldername/o/objectname?alt=media

I don't know if the directory is supposed to be submitted as part of the main URL or as a query parameter or somewhere else. Please note that I've submitted the Access Token through the header, too.

I'd also like to be able to store and list objects within a sub-directory so any help with that would be greatly appreciated too.

Could anyone please advise?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...