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

121
Visualizações
Save a .txt file in local storage

Is there any way I can save a .txt file in the local storage and load it back in later? I have an file input element in html where I can load in files. The problem is, that when I reload the code I always need to reselect the file...

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can save only content but not files. If you have the possibility to read out the text file on the server and pack it into a json, then you can read out the json on the client side and pack it into your local storage.

If you do not have a server available, you can do this on the client side with: new XMLHttpRequest();. Read the file and save the content in your localstorage. In this sense: localStorage.setItem('MyContentFromTextFile', content)

about 4 years ago · Juan Pablo Isaza Relatório
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