2016-05-13 52 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。

相關問題