Currently, I am utilizing Vue js 3 in combination with Firebase 9. My objective is to upload images to a specified folder, however I seem to be encountering some difficulties. Whenever I attempt to do so, the file gets renamed to 'product' and uploaded to the main folder.
uploadImage(e) {
const file = e.target.files[0];
const storage = getStorage();
const storageRef = storageReference(storage, 'products/');
uploadBytes(storageRef, file);
}
As it stands, when I execute this action, the file retains its original name but ends up in the primary directory.
const storageRef = storageReference(storage, file.name);
I am seeking guidance on how to ensure that the file ascends to the products folder retaining its existing name. Appreciate any assistance provided! Thank you!