0

I want upload a file using the chrome console. Thats what I do:

document.getElementById('design-upload-open-file-browser-qa').style.display='block';
document.getElementById('design-upload-open-file-browser-qa').children[0].value='path to file';

The first line is to activate the input field. I get the error: VM1929:1 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. at :1:9

Here the elements: enter image description here

Thanks in advance!

1 Answers1

2

You cannot set the value of an input of type file for security reasons.

How to set a value to a file input in HTML?

Paul Hoke
  • 115
  • 2
  • 7