Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

62
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!