I post a form with file (enctype="multipart/form-data") to node.js (express.js framework) and just want to send this same post request like it is just to different server. what is the best approach in node.js?
Follow this rules when creating a multipart form: Specify enctype="multipart/form-data" attribute on a form tag. Add a name attribute to a single input type="file" tag. DO NOT add a name attribute to any other input, select or textarea tags.
Create a folder- images, in the root directory. const imageStorage = multer. diskStorage({ // Destination to store image destination: 'images', filename: (req, file, cb) => { cb(null, file. fieldname + '_' + Date.
remove express.bodyParser and try pipes like these:
req.pipe(request('http://host/url/')).pipe(res)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With