ERR_CONNECTION_RESET When uploading large image on NodeJS

0

Good morning, I have a problem when I try to send large image with node, formidable use

app.post ('/ upload / image', (req, res, next) = > {    var form = new formidable.IncomingForm ();    form.multiples = true;

form.on ('fileBegin', (field, file) = > {      var filename = crypto.createHash ('md5'). update (file.name) .digest ("hex") + ".png";      file.path = './public/uploads/' + filename;      req.session.linkImage="/ uploads /" + filename;

 res.end('uploaded');

});

form.on ('error', (err) = > {      console.log ('An error has occured: \ n' + err);    });

form.on ('end', (fields, file) = > {

 res.end('success');

});

form.parse (req);   });

Could you help me solve this problem?

    
asked by anonymous 30.06.2017 / 16:30

0 answers