How to call the resource browser to open a local folder in php
临渊
临渊 2019-03-26 20:03:58
0
3
1097
我做一个图片管理的页面,要在双击图片标题的时候打开本地图片所在的文件夹

Double click here:

echo '<tr><td>';

echo '<div ondblclick="openimgdir(event)">';

echo dirname($tempdir);

echo '</div></td></tr>';

at Open the passed path in the openimgdir function

var obj=event.srcElement;

var direname=obj.innerHTML

// var filename="E:"

try{

var obj = new ActiveXObject("wscript.shell")

if(obj){

obj.Run(direname,1,false )

obj = null

}

}catch(e){

alert("Please confirm whether the file or drive letter exists")

}

After writing this, it still cannot be opened

临渊
临渊

reply all(1)
欧阳克

Is this folder for linux or windows? Check to see if there is no permission.

  • reply In Windows system, it should be a problem that JS does not have permissions. Now use the registered URL PROTOCOL, and then pass the path to the exe file and open the local folder. I wonder if there is a simple store method?
    临渊 author 2019-03-28 18:23:17
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!