0

Is it possible to populate an input file automatically.

I try by myself but I'm no enough good find a solution to do it.

I can't do it in the console like if i do it manually. I think JS is the way to do it, each time the same file in the same input...

Same code as this example : https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_type_file

DarkBee
  • 16,592
  • 6
  • 46
  • 58
  • 1
    No, it's not possible, JS in browsers can't access the local file system without user's interaction. – Teemu Feb 17 '22 at 09:58
  • The duplicate covers the case where you have a file in memory and want to assign it to the input. If you mean "Can a webpage pick a file from the visitor's file system without the user interacting" then no, that would be a massive security problem. Websites shouldn't be able to read my hard disk just because I visit them. – Quentin Feb 17 '22 at 10:03
  • It's also possible to clone the input, that way you need to bother a user only once to select a file or files. But the question doesn't introduce any use-case, giving more accurate answer is not possible. – Teemu Feb 17 '22 at 10:07

0 Answers0