2016-05-13 56 views

回答

1

我发现我可以使用getSignedUrl,这是为了让某些临时访问(例如写)到一个文件:

bucket = gcs.bucket('aBucket') 
bucket.file('aFile').getSignedUrl({ 
    action: 'write', 
    expires: moment.utc().add(1, 'days').format(), 
}, (error, signedUrl) => { 
    if (error == null) { 
    console.log(`Signed URL is ${signedUrl}`) 
    } 
}) 

为了上传文件,发出PUT请求获得的签名URL。

相关问题