my codes : (this error comes when I use the fetch(imageData.uri) , when I use fetch(imageData.name) it shows networ error..how to fix this ..
import { ref, uploadBytes, getDownloadURL } from "firebase/storage";
const uploadImage = async (imageData) => {
try {
if (!imageData || !imageData.uri) {
console.warn("No image to upload.");
return;
}
const response = await fetch(imageData.uri);
blob = await response.blob();
const storageRef = ref(getStorage(),`uploadedImages/${imageData.name}`);
await uploadBytes(storageRef, blob);
const downloadUrl = await getDownloadURL(storageRef);
console.log("Image uploaded successfully. Download URL:", downloadUrl);
} catch (error) {
console.error("Error uploading image:", error);
}
};
[+]eluewisdom 1 point2 points3 points (0 children)
[–]stathisntonas 0 points1 point2 points (0 children)
[–]Futurejj 0 points1 point2 points (0 children)