After searching for a long time, I couldn't find any more detailed information. I only found fs.createReadSream&fs.createWriteStream&pipe.
I don't quite understand how to use it. Is there any simpler and more crude output case? Just output a video directly. (Video size 4g budget);
Oh, there is one more thing, how to save the video uploaded by the front end (video size 4G budget);
videoshow.
PS: By the way, you should make good use of Google and GitHub, and colleagues should make good use of English search instead of Chinese and Baidu.
var fs = require('fs');
var url = require("url");
var server = require('http').createServer(function(req, res) {
}).listen(8080);
server.on('error',function(err){
console.log('err');
});
//Note
//You can use the following code to replace the above: rs.pipe(res);
//But when the writing speed is slower than the reading speed, problems will occur. Of course, for playing mp3 files on localhost There is no problem
//So we should choose pipe to write the stream. Pipe can better handle the problem of inconsistent reading and writing
//rs.on('data',function(chunk){ res.write(chunk); });
//For more details, refer to: /a/119...
node part------------------------------------------------- --------------------------
<html>
</html>
html part------------------------------------------------ --------