Skip to content

Instantly share code, notes, and snippets.

const saveImgTemp = function (req, res, next) {
const writeStream = fs.createWriteStream(
path.join(__dirname, "../store/test.png")
);
req.pipe(writeStream);
// After all the data is saved, respond with a simple html form so they can post more data
req.on('end', function () {
res.send({msg: "Works"})
});