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.
{
"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