Icy
How to handle file uploads
Well, besides the files themselves, I need to also send other (text) information in the request, so that's why I used multipart. If there's a better way, I'm down to use that. As for the requirements, nothing is currently set in ground, I'm mostly just researching.
Psi, in your code example above, what does the
createWriteStream
call? Is it some library or custom function? And pipeline
too. Sorry I don't have much experience with what your're doing there.44 replies
How to handle file uploads
Ok, so just to clarify, uploading multiple large files (like 500mb) in Hono using
parseBody
will increase the memory usage to 3gb+. On the other hand, when using multer in express or nest, memory usage will not exceed 80mb. Also, when Hono is hit will multiple files from several requests, it will significantly slow down responses of other API endpoints. Think like from 5ms to 300ms. That doesn't happen in nest. That's the problem I'm facing and wanted to figure out.44 replies