For days now, I've been attempting to successfully upload a file to firestorage using firebase functions but haven't had any luck. This is the progress I've made so far:
export const tester = functions.https.onRequest(async (request, response) => {
await STORAGE.bucket("[url]").upload("dir", {
destination: "dest",
});
response.send(STORAGE);
});
Unfortunately, it's not working out as I expected because I am required to upload a blob.
I have also attempted following the examples provided by Google on git previously, but encountered issues with my Typescript implementation.
function uploadRef() {
// [START storage_upload_ref]
// Create a root reference
var storageRef = firebase.storage().ref();
// Create a reference to 'mountains.jpg'
var mountainsRef = storageRef.child('mountains.jpg');
// Create a reference to 'images/mountains.jpg'
var mountainImagesRef = storageRef.child('images/mountains.jpg');
// While the file names are the same, the references point to different files
mountainsRef.name === mountainImagesRef.name; // true
mountainsRef.fullPath === mountainImagesRef.fullPath; // false
// [END storage_upload_ref]
}
Does anyone have advice or solutions for this issue?