node.js - Cannot download Google Cloud Storage file with Node gcloud package -


i have gcloud set in application , seem authenticated. can run following without problem:

googlecloud = require('gcloud')({ /* credentials */ }); googlecloud.storage().createbucket('mybucket', function (err, res) {}); 

i can following retrieve bucket , file without problem:

var bucket = googlecloud.storage().bucket('mybucket'); var file = bucket.file('myfilename.ext'); 

and when file.getmetadata(), see empty object convert expected information.

however, when attempt download file, problems.

var pathtofilename = 'public/test.pdf'; file.download({ destination: pathtofilename }, function (err) { console.log(err); }); { [error: enoent, open '/public/test.pdf'] errno: 34, code: 'enoent', path: '/public/test.pdf' } 

i have tried prepending pathtofilename /, ./, , ../ no success. same error have have gotten in past configuration not authorized or file name incorrect (although unable create buckets , metadata). there still possibly issue acl or other permission i'm not aware of?


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -