control the working directory for ?

You cannot control the contents of a file input using JavaScript for security reasons. Otherwise, you could create a hidden form with a file input field, set it to a path, and submit the form with JavaScript in order to upload the file to your server without the user knowledge.

Unfortunately, I’m not aware of a way to set the default path for the file selector. If there is one, I’m sure it will be browser-specific and can only be used by setting some option in the client side, not through HTML or JavaScript.

Leave a Comment