简体   繁体   中英

C# after uploading image, get url of uploaded image in google cloud storage

I created an image uploader using c# mvc5. I managed to upload the images to google cloud storage. Now I want to get the url of the uploaded file to return to the user for reference . I've been looking around the docs in google and can't find it. Anyone can provide me some links or codes will be helpful. Thanks.

See the documentation page on Request URIs .

In general, if you upload to a bucket named foo and an object named bar/baz , the URL for your object will be:

https://storage.googleapis.com/foo/bar/baz

With the GCS C# .NET library , you can use one of the Storage.v1.Data.Object class properties:

  • MediaLink to get the download link, or
  • SelfLink to get the canonical URL for the object.

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