Javascript selection folder dialog box (web) _ javascript tips

Source: Internet
Author: User
When selecting folders in web application development, this is troublesome for web programmers. Because of local security restrictions, JS cannot access local files, folder selection is generally avoided, when I was writing a program, I also encountered the same problem. I started to try to use JS to traverse files, and there was no way to get the result, practice has proved that the best solution is to write an OCX control by yourself, so you only need to register the OCX control, and the OCX control is highly scalable, that is to say, to introduce the functions of vc \ delphi to the web, its functions can be imagined!
I will not describe the OCX development process here. I will share the OCX control I wrote with you and hope to help some friends.
The OCX control provides a getFiles () method. You only need to obtain the control object and call the getFiles () method to obtain all the files in the corresponding path, for example:

This control can select any folder under any drive letter. In the figure, the following buttons are used to obtain the file list through the web js method, OCX
The getfiles(), for example, 1.jpg;2.jpg;3.jpg. Use the ";" link in the middle of each file name, and use the split method in js to separate the file.
The page code is as follows:

The Code is as follows:






Untitled document

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.