Answer the question
In order to leave comments, you need to log in
How to process files and other data(input) in NodeJS server?
How to process files and other data in nodeJS server?
File upload was using Dropzone
Answer the question
In order to leave comments, you need to log in
If you use Express as a web server, then:
expressServer.post('/', function (req, res) {
fs.readFile(req.files.inputFieldName.path, function (err, data) {
// inputFieldName - имя input в форме
var newPath = __dirname + "/uploads/uploadedFileName";
fs.writeFile(newPath, data, function (err) {
res.redirect("back");
});
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question