This is how I fixed it for Strapi v4
const onSubmitHandler = async (e) => {
e.preventDefault();
const formData = new FormData();
formData.append('files', image);
formData.append('ref', 'api::event.event');
formData.append('refId', evtId);
formData.append('field', 'image');
const res = await fetch(`${API_URL}/api/upload`, {
method: 'POST',
body: formData,
});
if (res.ok) {
imageUploaded();
} else {
console.log(res);
}
};