Can somebody please help? I have been searching documentation for hours, but can't find the right solution. I am trying to just upload a hard coded image that I have in my project called house.jpg. However, when I upload it, it is not uploading properly. I specified that it is an image, but it just shows 'error loading preview'. It is also storing at 9 bytes, when it should be storing around 50KB.
var storageRef = storage.ref();
var propertyRef = storageRef.child(mainImageUrl);
console.log("adding property image")
const myPromise = new Promise((resolve, reject) =>{
var metadata = {
contentType: 'image/jpeg',
cacheControl: 'public,max-age=300',
};
var image = "../../assets/icons/house.jpg"
console.log(image)
propertyRef.put(image, metadata).then((snapshot)=>{
console.log('Uploaded a file', snapshot);
snapshot.ref.getDownloadURL().then((downloadURL)=>{
console.log("url: ", downloadURL);
resolve(downloadURL);
})
}).catch((error)=>{
reject(error);
})
});