Click here to Skip to main content
15,907,183 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In C#,What will be solution? Once upload file or image to google cloud and try to view file or image on web page unable to fetch image from google cloud storage and getting error given bellow.

JSON
{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Anonymous caller does not have storage.objects.get access to cfad42397dad40bb80dca581986bad2d/Demo1/Black Pather.jpg.",
    "locationType": "header",
    "location": "Authorization"
   }
  ],
  "code": 401,
  "message": "Anonymous caller does not have storage.objects.get access to cfad42397dad40bb80dca581986bad2d/Demo1/Black Pather.jpg."
 }
}


What I have tried:

I am uploading file(Image) on Google Cloud and Try to bind image on Web form. while uploading file, i saved file url that on getting once upload the file from on gooogle the google cloud
var result= storage.UploadObject(BucketName, $"{baseUrl}/{objectName}", "application/x-directory", valStream);

result.SelfLink

and binding this url at image control from local database
Posted
Updated 19-Feb-18 9:10am
v3
Comments
ZurdoDev 19-Feb-18 9:33am    
The error seems to indicate that you are not providing the proper credentials.

1 solution

The message is clear, Google Cloud refuses to serve a content to a client which has not been properly authenticated, which is something everyone would expect actually.
Provide proper credentials to Google Cloud services and you will get rid of the issue.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900