-
Notifications
You must be signed in to change notification settings - Fork 640
Description
Hi team,
I have spent a lot of time to solve the problem and also spent a lot of time to search the solution on net but every time I failed. The scenario is that
I am using @google-cloud/storage to upload my image on google cloud storage. Everything is fine. Images successfully uploaded on cloud. Now I want to show these images to my users but I didn't want to give public permission to images. So I created a signed url and trying to download them but everytime I am facing the following problem
<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>
The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.
</Message>
<StringToSign>GET 1486639481 /<my bucket name>/<my image name></StringToSign>
</Error>
here is my code
//get signed url
action: 'read',
expires: Date.now() + 76000000,
contentType: 'image/jpeg'
};
var file = bucket.file('TestingImage.jpg').getSignedUrl(options, function (error, signedUrl) {
console.log('signed url...');
console.log(signedUrl);
});But when I put this signed url in browser it give me the error.
I am following the url for uploading image
https://googlecloudplatform.github.io/google-cloud-node/#/docs/storage/0.6.0/storage
How ever I can download these image in nodejs using file.download() but I want to view this image on browser
Please guide me when am I wrong.