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

63
Visualizações
How to hard code a file object to a model attribute javascript

I have a file object like so in the browser memory: enter image description here

The file is only added to the attribute on button click however I would like to hardcode the addition of that file object on the initialization of the view, so something like this:

initialize(options){
  this.model.add({
        "file": {},
        "name": "Saved file",
    })
}

However im not quite sure how to hardcode a File object for a specific file if that makes sense. How could I go about doing this? I realize I would probably need to make use of the javascript File object, but not quite sure how to hardcode for a specific file from my computer. Sorry if the question is weirdly worded kinda new to js.

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