DenoDDeno
Powered by
EsenteE
Denoβ€’3y agoβ€’
5 replies
Esente

Streaming FormData

I have
Deno.serve
Deno.serve
a HTML page with
<form enctype="multipart/form-data">
<form enctype="multipart/form-data">
with a
file
file
input.

I also have a handler for
POST
POST
that would take that
File
File
, split it, and sends the chunks to another endpoint.

What I have so far in the
POST
POST
handler is to
await request.formData()
await request.formData()
to retrieve the File from there and split.

It works fine for small files, but for big file, the handler would wait until the whole file is sent before starting to split, which can overflow the memory.

Is there a way that I can immediately stream the File from the browser's request, and split it as more data come in?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Streaming large files with fetch and FormData
disintegratorDdisintegrator / help
3y ago
upload files formdata
ZabiZZabi / help
4y ago