Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

121
Vistas
Downloading 100+ Images to Local Drive JavaScript and Node

Our engineering design firm has engineering photos that engineers use for designing. Each folder can contain 100+ engineering photos. We would like to know how to implement the best logic for the engineer to download all images (given that there are 100+ photos in the folder) as a zip requesting it from the frontend and sending the folder name to the server to fetch the pictures that belong to that folder name and download them to their local drive i.e desktop or documents folder.

***MY FRONTEND CODE***
const saveImgsBtn = document.getElementById('saveImgsBtn')


saveImgsBtn.addEventListener('click', async()=>{

  const folder = {
    name: 'IDxyz123_images'
  }
  const response = await fetch('http://localhost:5000/engineer/design/getImages',{
    method:'POST',
    body:JSON.stringify(folder),
    headers:{
      'Content-Type':'application/json'
    }
  })

  let result = await response.json()
  
})


***MY BACKEND CODE(NODE JS)***
  let mainFolderPath = './design_images'
    let childFolder = req.body.name

    let folderURL = `${mainFolderPath}/${childFolder}`

    let folderExists = fs.existsSync(folderURL)

    if(folderExists){
      res.status(200).json({
        message:'Folder exists. Would you like to download images?'
      })
      //Logic to download images to local drive
    }else{
      res.status(404).json({
        message:'Folder does not exist. Please verify if folder name is correct.'
      })
    }


about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda