Reputation: 141
I want to select a file from a path that I specify in the input box automatically into my state variable, I don't want to open a select file dialog to select a file? any way thhis can be done?
Upvotes: 0
Views: 157
Reputation: 903
Unfortunately (or fortunately for all users around the world), there is no way to gain direct access to user's file system using JavaScript in a browser.
You are limited to the selection dialog or drag&drop behavior. It's because of security reasons and how sandboxes used in browsers work.
Upvotes: 1