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

215
Views
Upload file from local through Chrome console

I have an input element like that.

<input type="file" name="submitedFile" class="hidden-file-input">

I would like to upload file automatically by JS from Chrome console.

Something similar to sendkeys in Selenium.

I found this answer here.

Then I tried something like that.

document.getElementsByName('submitedFile')[0].value='C:\\myfolder\\myfile.txt';

But I have this error.

Uncaught DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.

How I can solve this error ? or is there another way to upload file from my local device to the browser through Chrome console automatically ?

Edit:

I think the problem that the browser cannot access the local files in the OS. For that, I tried to upload the folder in the Filesystem in the Sources of Chrome. But I still have the same error. Is there a way that I can use the files in the Filesystem ?

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!