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

232
Views
Cómo permitir la carga de archivos grandes al servidor linode usando node js multer

Hola chicos, tengo un servidor Linode y estoy tratando de cargar un archivo a través de un punto final a mi servidor backend alojado en mi servidor Linode, cuando cargo archivos de menos de 1-2 mb funciona, pero por encima de eso no funciona, lo intenté probando la misma funcionalidad de carga usando heroku funcionó, pero no funciona en mi servidor Linode, en lugar de eso, mi axios devuelve un "error de red". ¿Hay alguna configuración que deba hacer para permitir la carga de archivos grandes? multrar

mi código

 try{ const formData = new FormData(); formData.set('txt', textValue) formData.set('post_for', PostFor) fileList.forEach(element => { formData.append('files', element) }) setloading(true) setError(); axios.post(`${ENDPOINT}/feed/`, formData,{ headers:{token:localStorage.token,"Content-Type":"multipart/form-data"}, onUploadProgress: (data) => { setProgress(Math.round(100 * (data.loaded / data.total))); }, }).then(res => { if(res.data){ setloading(false) setFileList([]) setpreviewImage([]) setpreviewVideo([]) setText('') setError(); socket.emit('refresh_feed') message.success('feed uploaded successfully') setTimeout(()=>{ setProgress() },6000) }else if(res.error){ setloading(false) message.error(res.error) } }) .catch((error) => { const code = error switch (code) { case "FILE_MISSING": setError("Please select a file before uploading"); setloading(false) break; case "LIMIT_FILE_SIZE": setError("File size is too large. Please upload files below 1MB!"); setloading(false) break; case "INVALID_TYPE": setError( "This file type is not supported. Only .png, .jpg, and .jpeg files are allowed" ); setloading(false) break; default: setError("Sorry, something went wrong"); setloading(false) break; } }); }catch (error) {} }
 const storage = multer.diskStorage({ destination: function (req, file, cb) { cb(null, `./src/uploads`) }, filename: function (req, file, cb) { // if(file.mimetype === 'video/mp4' || file.mimetype === 'audio/mpeg'){ // return cb(null, Date.now() + '.mp3') // } cb(null, Date.now() + path.extname(file.originalname)) } }) export const upload = multer({ storage: storage })
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!