Closed mkpankov closed 5 years ago
Wireshark shows the request w/o problems:
So it seems the server is at fault?
failed: Multipart boundary is not found
@fafhrd91 what are you trying to say?
That is from log output you posted
I've seen that, and I don't see how this explains why the example doesn't work. If you look at wireshark screenshot, there are boundaries, and all of them seem correct to me. If they aren't, please point out what's the problem, in your opinion.
Python client might be broken. Browsers work, I trust browser impl more
I've successfully implemented multipart and built my formdata object using client side JavaScript. Perhaps you can try using the browser first then mimic in your own client code?
@mattlockyer that's nice, can you post minimal working example with your JavaScript client?
Made a PR to remove python dependency I didn't like the lack of consistency, some times it fails and some times it passes.
Some reports of this issue on aiohttp https://github.com/aio-libs/aiohttp/issues/3544
Pretty basic.
data
is ArrayBuffer.
Not setting the type in the fetch body was a bit tricky, but I had to leave this out for another project involving a Go server as well. I'm guessing when the body
is well encoded, servers determine the content type header themselves?
const file = new File([data], 'upload')
const formData = new FormData();
formData.append(fileName, file);
const upload = await fetch(SERVER + '/auth/upload', {
body: formData
}).then((res) => res.json())
Server:
Client: