Can the upload speed of a file in express be limited?
For instance, if a user has 10Mbps internet speed, is it possible to restrict their file upload speed to 1/10 of that?
I tried using the throttle module based on the suggestion in this post , but it did not work for me.
This is the code I used:
const Throttle = require("throttle");
route.put("/api/upload", (req, res, next) => {
req.pipe(new Throttle(1)).pipe(fs.createWriteStream(join(__dirname, "./file.png")));
})