Icy
Icy
HHono
Created by Icy on 2/24/2025 in #help
How to handle file uploads
alright guys thx for your help
44 replies
HHono
Created by Icy on 2/24/2025 in #help
How to handle file uploads
so you do 2 requests from client? how would you handle a case where you wouldn't receive complete data in the 2nd request, after file was uploaded?
44 replies
HHono
Created by Icy on 2/24/2025 in #help
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
HHono
Created by Icy on 2/24/2025 in #help
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
HHono
Created by Icy on 2/24/2025 in #help
How to handle file uploads
yup, spot on
44 replies
HHono
Created by Icy on 2/24/2025 in #help
How to handle file uploads
Yes, store a file in a temporary storage, validate and move. Just like multer does, however multer isn't compatible with hono, so I wonder if there's some other package or does it need to be written manually.
44 replies