Monday 1 May 2017

Send response end to begin or random order?

Basically I'd like to make it possible to download a file whilte it's being generated, without having to wait until the generation is done.

I need to respond to a http request with a potentially 10 to 200mb large "file" but the first 200 bytes of that file contains information (such as the number of records) that is only available once the whole response has been generated. In the mean time, I'd like to send the progress to the client as the response is being built up and then at the end, I'd like to send the first 200 bytes of that response.

Is that somehow possible at all? I couldn't find anything in the Node.js docs (https://nodejs.org/api/http.html)



via Markus

No comments:

Post a Comment