oak
oak copied to clipboard
Multipart form-data parsing/stream handling problem
OAK v9.0.0
When a form-data is posted or put, it works well with primitive form fields,but if the form-ata contains a file:
- Time to respond takes much more time than expected
- formdata.files entpies are created propersy, except
content
field is undefined - And there are no error messages
A more complete reproduction is required. Like what version of Deno you are using, what your command line looks like and a minimal reproduction of code.
- Time to respond takes much more time than expected
That is a very vague statement.
Thank you for your prompt respond.
Deno: 1.13.1 Oak: 9.0.0
The server code has been simply taken from Oak documentation and tests:
const body = ctx.request.body({type: 'form-data'})
const formdata = await body.value.read()
That's all. Here I got a FormData structure with fields
and files
elements. formdata.files[0].content
is undefined
, however, rest of the structure is perfectsy ok.
And the client runs on Deno 1.13.1 as well. I am preparing the request as follows:
const formdata = new FormData()
formdata.set('filename', basename)
//...
const file = Deno.readFileSync(filepath)
const blob = new Blob(file, {type: 'application/zip'})
formdata.set('datafile', blob, basename)
const response = await fetch(url, {
method: 'PUT',
body: formdata
})
any progress here? thanks.