Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

80
Views
Envío de imagen e información adicional a través de HTTP

Quiero enviar una imagen Y otra información de texto, vi que para la imagen necesito usar enctype="multipart/form-data" en el formulario. Pero hacer esto hace que no pueda ver la otra información necesaria.

 <form action="/new" enctype="multipart/form-data" method="post"> <input type="text" id="name" value=""/> <input type="file" name="image" accept="image/*" value="Compagny Logo"/> <input type="submit" value="Load compagny"/> </form>
 var storage = multer.diskStorage({ destination: (req, file, callBack) => { callBack(null, './public/images/') }, filename: (req, file, callBack) => { callBack(null, file.fieldname + '-' + Date.now() + path.extname(file.originalname)) } }) var upload = multer({ storage: storage }); router.post("/new", upload.single('image'), (req, res) => { console.log(req.file.filename) // work console.log(req.name) // does'nt work } });

¿Hay algún otro enctype que deba usar?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!