Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

206
Visualizações
set default file open path in electron application

How to set the default path in electron app that is used whenever users select files to upload (via HTML file inputs)?

Context: I have a website running in an electron application where users can upload and download files. Whenever users download files the save-dialog shows the default location. This is achieved by setting: browserWindow.webContents.session.setDownloadPath(myDefaultPath).

How could I do the same for the open-dialog? There is no setFileOpenPath() or similar.

Note: The open dialog is opened via <input type="file" ...> and not via the electron dialog. The download dialog is opened via file-saver-es if that matters.

Now in theory I could intercept the "select file"-button's click event and send an ipc message to the electron main process and open an electron dialog where I have control over the path. Then load the selected file and send the blob back via ipc to the website (renderer process). This seems awfully complicated for what I need. Hence the question.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda