i am currently working on a react app which uses Firebase Storage to store files. My problem is: i want to create a file and attach metadata to it before storing it on Firebase storage; as far as i know, now i have to
is there a way to make these 2 steps into 1?
Thanks in advance for your time
As explained in the Cloud Storage for Firebase doc, "when uploading a file, you can also specify metadata for that file".
// Create file metadata including the content type
var metadata = {
contentType: 'image/jpeg',
};
// Upload the file and metadata
var uploadTask = storageRef.child('images/mountains.jpg').put(file, metadata);