How to use the storage function from firebase-admin
Find comprehensive JavaScript firebase-admin.storage code examples handpicked from public code repositorys.
81 82 83 84 85 86 87 88 89 90 91 92
credential: admin.credential.cert(serviceAccount), storageBucket: 'csi-innovations.appspot.com' }); //firebase bucket var bucket = admin.storage().bucket(); //function to upload file async function uploadFile(filepath, filename) { await bucket.upload(filepath, {
0
4
2
+ 8 other calls in file
GitHub: DSSD-Madison/Helios
31 32 33 34 35 36 37 38 39 40
console.log(`File ${filePath} is not in CSV format, skipping...`); return false; } // create a reference to the Cloud Storage file and set up a CSV parser const bucket = admin.storage().bucket(fileBucket); const file = bucket.file(filePath); const csvStream = file.createReadStream().pipe( parse({ delimiter: [";", ",", "\t", "|"],
0
3
0
+ 4 other calls in file
420 421 422 423 424 425 426 427 428 429
}, contentType: pdfDoc.mimetype, cacheControl: 'public, max-age=31536000' }; const bucket = firebase.storage().bucket(); const filePath = `doc-file/${uuid() + '--' + pdfDoc.originalname}`; const blob = bucket.file(filePath); const blobStream = blob.createWriteStream({ gzip: true,
0
0
1
+ 34 other calls in file
176 177 178 179 180 181 182 183 184 185
}); } else { res.status(300).send({ msg: "SmeIPO Not Found" }); } } webApp.locals.bucket = admin.storage().bucket(); // const uploadImage = async (req, res) => { // const GeneralIPO = {
0
0
1
+ 15 other calls in file
firebase-admin.firestore is the most popular function in firebase-admin (560 examples)