When you click an event on the interface to upload files from the local disk or download the actual content to the local disk, the JS pop-up selection box is required to select the path of the local disk.
The following part of JSCodeThe logical structure of the local disk is displayed, which is used to select the folder path.
Function Browsefolder (){
Try {
VaR Message = "Please select the folder path ."; // Selection box prompt information
VaR Shell = New Activexobject ("Shell. Application ");
VaR Folder = shell. browseforfolder (0, message, 0x0040, 0x11 );// Start Directory: My computer
// VaR folder = shell. browseforfolder (0, message, 0); // start Directory: Desktop
If (Folder! = Null ){
Folder = folder. Items (); // Returns the folderitems object.
Folder = folder. Item (); // Returns the folderitem object.
Folder = folder. path; // Return Path
If (Folder. charat (Folder. Length-1 )! = "\\"){
Folder = folder + "\\";
}
Return Folder;
}
} Catch (E ){
Alert (E. Message );
}
}
Haha. If you have any better methods, please kindly advise.