I've already tried multiple code for uploading, from axios to fetch. But, it always end up with same result. Here's the simplest it get:
const formData = new FormData();
formData.append('file', ref)
const response = await fetch(
new Request(res.uploadSignedUrl, {
method: 'PUT',
body: formData,
headers: new Headers({
'Content-Type': ref.type,
})
})
)
The code above is responding with status 200, but whenever I visit the image link of the uploaded image, it gives me a small white box image.
screenshot of small white box image
And when I remove the header at 2nd parameter object of request fetch, the Content-Type to be specific, the link of the uploaded image doesn't transfer me to a website or anything. It just automatically downloads an unknown file type with surprisingly the exact file size of the supposed to be uploaded image.
screenshot of automatic download
Do note that I've already tried this with multiple file types. Any given thoughts about this issue will be deeply appreciated.
Edit: Also, I managed to come in contact with our backend dev. Here's the result at postman I think: screenshot of payload result
ANSWER: I commented it here