JS 팝 업 파일 저장 창

836 단어
//JS         

function BrowseFolder() {
    var mypath = window.location.href;
    alert("     :" + mypath);
	
    var saveFolder="";
    var Message = "       "; 
    var Shell  = new ActiveXObject("Shell.Application");
    var Folder = Shell.BrowseForFolder(0,Message,0x0000,0);
    if(Folder !=null)
    {
       if(Folder == "  ")
       {
          saveFolder = new ActiveXObject("wscript.shell").SpecialFolders("Desktop");
       }
        else
       {
          Folder = Folder?Folder.items().item().Path:'';
          saveFolder = (/^\w:/.test(Folder))?Folder:'';
       }
       saveFolder.replace("%20"," ")//     20%     "" 
       alert("      :" + saveFolder);
    }

    return saveFolder;
 }

좋은 웹페이지 즐겨찾기