Home > front end >  The react in the project how to open a folder selection box
The react in the project how to open a folder selection box

Time:12-11

The search on the net, mostly new ActiveXObject (" Shell. Application "), but when I open the page in the react program, will be submitted to the ActiveXObject can not find,,, what is the way to open a folder selection box, I just want to choose a folder, a path, for behind me the downloaded file, and bosses, help confused me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Thank you very much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

CodePudding user response:

ActiveXObject (" Shell. Application ") is the Internet explorer Only

CodePudding user response:

 


<body>







Document. QuerySelector (' # b ') addEventListener (' change ', e=& gt; {
For (let entry of e. arget. Files)
The console. The log (entry. The name, entry. WebkitRelativePath);
});
</script>









Chrome browser to use the above code

CodePudding user response:

IE browser to use the
https://www.jb51.net/article/18917.htm

If to be compatible is the use of two sets of code

CodePudding user response:

reference 3 floor bath _ fire phoenix reply:
Internet explorer browser to use the
https://www.jb51.net/article/18917.htm

If to be compatible is the use of two sets of code
, add a micro nobuyuki not, get rid of

CodePudding user response:

refer to the second floor bath _ fire phoenix reply:
 


<body>







Document. QuerySelector (' # b ') addEventListener (' change ', e=& gt; {
For (let entry of e. arget. Files)
The console. The log (entry. The name, entry. WebkitRelativePath);
});
</script>









Chrome browser to use the above code
the method finally get to you is not a complete path
  • Related