How to use the javascript when you click (Select file) to set the path to the file? Those. when you click a button, to have the specified file automatically selected
- It seems that, according to the safety rules, the station does not have access to this ... You can see the latest change, file type and size, but I did not hear the path ... - user190134
1 answer
You cannot do this in modern browsers for security reasons.
Neither the file should be selected automatically, the address of the file should be found, nor the default directory specified.
Because there would really be a lot of problems with security and compatibility, and very little convenience.
For example, if you simply take and give the opportunity to pre-install the selected file, then this would allow an attacker, unnoticeable for the user, to load some file with configs by default.
If you give a pre-install part of the path, then this would allow the attacker to find out how your file system works. For example, do you have a D: / PornWithPonies daddy on your computer?
Therefore, it is impossible and that's it.