-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Labels
Description
Consider this minimal working example (Multer v1.1.0 on Windows 7, OS X 10.11 and Ubuntu 14.04 with node v4.2.1):
var express = require('express')
var multer = require('multer')
var upload = multer({ dest: 'uploads/' })
var app = express();
app.post("/upload", upload.single("file"), function(req, res, next){
res.end("uploaded to: " + req.file.filename);
});
app.listen(80);and the following test script
# create large test file
$ dd if=/dev/urandom bs=2G count=1 of=upload
# upload
$ curl -F "file=@upload" http://localhost/upload
# upload again, but cancel before upload is finished
timeout -s SIGKILL 2s curl -F "file=@upload" http://localhost/uploadExpected behavior:
Only the first file is persisted, the second is removed after the upload got canceled.
Actual behaviour:
Both files are stored in the uploads folder
simonwep, this-self, geersch, ktjd123, AndoGhevian and 2 more