Wednesday, 11 December 2019

Upload large file via POST; parse and store in db. Is this possible?

I'm not really a JS developer and I feel I'm way out of my comfort zone with this one:I have an express app (with body parser and multer) that has to accept an upload of a large file via POST, which then needs to be parsed and stored in the db (line by line).The problem I have is obviously with memory. I've written the logic which works for in memory files, but when I try a 5-10GB file, I get OOM.Is there a way I can do this with streams? I don't want to store the file on the disk.Also, not really a requirement but that file is originally gzipped and it would be cool if the client didn't have to extract it.I would really appreciate some help here. Thanks

Submitted December 11, 2019 at 10:13PM by quantastical

No comments:

Post a Comment