There is no way. Practice has proved that the best solution is to write an OCX control yourself. In this way, you only need to register the OCX control. At the same time, the OCX control is very scalable, which means that the functions of programs such as vcdelphi can be introduced into the web. , its functions can be imagined!
I won’t explain the OCX development process here. I will share the OCX control I wrote in the hope that it can help some friends.
This OCX control provides a getFiles() method. As long as you get the control object and then call the getFiles() method, you can get all the files in the corresponding path, as shown below:
This control You can select any folder under any drive letter. The bottom button in the picture is the input in the web. The file list is obtained through the js method in the web. The getFiles() method of OCX
returns the file name string. The style is as follows 1.jpg; 2.jpg; 3.jpg, use ";" link in the middle of each file name, and use the split method in js to separate them.
The page code is as follows:
In this way, you can use this control to select any folder, and you can get all the contents in the folder through js. Due to limited space, we will not explain more functions of OCX here. The next article will add an upload function to OCX. , so that the entire folder can be uploaded and resumed uploading is supported.
Final note: You need to register the control when using OCX
Registration method: Run cmd, enter the OCX control at C:123.OCX, run RegSvr32 c:123.OCX in cmd, it will prompt that the registration is successful, and then you can use it on the web page!
Package download