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
Post a Comment