简体   繁体   中英

download object from Google cloud storage using c#

i want to download bucket object's from Google cloud storage. but i stuck in some differed scenario. our scenario is : we have one main admin account in that we created our bucket that contains files from DFA(Doubleclick For Advertisers) files. and we gave writes to two another accounts to access this bucket.but i am unable to see my admin's bucket here. in one account we enabled billing and in that account we are able to download files (the file and bucket we create manually for testing).but the bucket created by admin we are unable to see. we are using asp.net (c#) for download.that i download from " https://github.com/acropolium/SharpGs/blob/master/SharpGsDemo/Program.cs "

The Project is working nice for account that contains only one API project. but in my account i have two different API projects both belongs to different Projects that i can see in( https://cloud.google.com/console#/project ). but in current "SharpGs" Project ,we have "RestApiClient.cs" class in that class we have one method "CreateRequest" that Create Request. here i this method i want to send my project id like request.Headers.Add(@"x-goog-project-id", " * ");** if i add this line it throw an error:"The remote server returned an error: (403) Forbidden."

It sounds like you are attempting to fetch a list of all buckets to which these projects have access (let me know if I'm mistaken). This is not currently a feature of Google Cloud Storage. If your account is a member of a project, it can list all buckets belonging to that project. However, you cannot ask for a list of of all buckets to which an account can write.

However, just because these accounts cannot get a list of buckets, they can certainly access any bucket to which they've been given write access. Simply access that bucket directly by name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM