this code working!
const uploadImageToStrapi = async (imageData) => {
try {
const formData = new FormData();
formData.append(“files”, imageData, ${new Date().getTime()}.png);
const response = await axios.post(
"http://127.0.0.1:1337/api/upload",
formData
);
return response.data[0]; // Assuming Strapi returns the uploaded image information
} catch (error) {
console.error(“Error uploading image to Strapi:”, error);
throw error;
}
};