I’m trying to upload images to firebase storage, and it is working fine if a image is uploaded using the tinymce image button
Instead if I copy and paste the image or drag and drop it won’t work.
This is what I’m trying
images_upload_handler: async (blobInfo:any, progress:any) => {
return new Promise((resolve, reject) => {
let blob: Blob;
let filename: string;
blob = blobInfo.blob();
filename = blobInfo.filename();
const filePath = 'content/uploaded/images/lp/' + Date.now() + "-"+ filename;
const storage = getStorage();
const storageRef = ref(storage, filePath);
const uploadTask = uploadBytesResumable(storageRef,blob);
() => {
// Upload completed successfully, now we can get the download URL
getDownloadURL(uploadTask.snapshot.ref).then((downloadURL) => {
resolve(downloadURL);
});
}
);
})
},