I've used storage API in cloud function to upload some XML files as following:
await bucket.upload(filePath, {
destination: fileName,
resumable: true,
metadata: {
cacheControl: 'no-cache',
metadata: {
firebaseStorageDownloadTokens: uuidv4() //generate access token as I've found out on some other answers
}
}
});
But then when I go to Firebase storage console to view the files uploaded, I'm unable to open them without manually creating new access token for them. I've tried generating download URL right after uploading as below
await bucket.file(fileName).getSignedUrl({
action: 'read',
expires: new Date().setDate(new Date().getDate() + 1) //expires after 24 hours
});
but nothing changes. What should I do for now?