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

64
Vistas
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 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