search

Home  >  Q&A  >  body text

How to call the resource browser to open a local folder in php

我做一个图片管理的页面,要在双击图片标题的时候打开本地图片所在的文件夹

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

临渊临渊2060 days ago1144

reply all(3)I'll reply

  • 查无此人

    查无此人2019-03-28 17:43:16

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

    reply
    1
  • 临渊

    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?

    临渊 · 2019-03-28 18:23:17
  • Cancelreply