'Is it possible to stream a video from client side to nodejs server and save it to a mp4 file?

hello everyone thanks for reading this , is it possible to send video stream from client side to nodejs server then save it to a file each time there is a new chunk of data.



Solution 1:[1]

You can use readable.pipe() and readable.unpipe() functions to achieve this. Here is a small example

const writable = fs.createWriteStream("<filename>");
res.unpipe(writable)

Here your response will serve as the readable stream and can be unpiped into the new writable stream you have created.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Eric Aya