I want to open a file browser in JavaScript and set a default directory to this file browser. For example, I will like to set the default directory to "C:\My Documents".
How to set a default directory?
It's better to use <input type="file"/>
, other controls are ok too.
This is impossible, as it is a security risk to let website code set any value on the machine.
Also, you can never be sure that directory exists.
What if I'm on a Mac? My stuff are in ~/Pictures
. What if I installed Windows on D:\
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With