使用 javascript (CRM 4.0) 在 IE 上打开文件夹?

发布于 2024-11-28 03:16:09 字数 675 浏览 0 评论 0原文

我想在 IE window.i 上查看我的特定文件夹。我使用 window.open();然后我收到错误“访问被拒绝”。我授予“每个人”对此文件夹的权限并共享它。

var oShell = new ActiveXObject("Scripting.FileSystemObject");
var Path="C:\\test\\"+crmForm.ObjectId;
  if (! oShell.FolderExists(Path) )
{
  oShell.CreateFolder(Path)
}    

crmForm.all.new_paylasim.DataValue=Path;
var urlField =crmForm.all.new_paylasim;

urlField.style.color = 0x0000ff;

urlField.style.textDecorationUnderline = true;

urlField.style.cursor = "hand";

urlField.ondblclick = function() {

var url = urlField.DataValue; // Or get it from somewhere else

if (url != null && url.length > 0) {
window.open(url);

}
}

有什么解决办法呢?

I want to see my specific folder on IE window.i use window.open(); and then i get an error "Access denied".I gave "everyone" permission on this folder and share it.

var oShell = new ActiveXObject("Scripting.FileSystemObject");
var Path="C:\\test\\"+crmForm.ObjectId;
  if (! oShell.FolderExists(Path) )
{
  oShell.CreateFolder(Path)
}    

crmForm.all.new_paylasim.DataValue=Path;
var urlField =crmForm.all.new_paylasim;

urlField.style.color = 0x0000ff;

urlField.style.textDecorationUnderline = true;

urlField.style.cursor = "hand";

urlField.ondblclick = function() {

var url = urlField.DataValue; // Or get it from somewhere else

if (url != null && url.length > 0) {
window.open(url);

}
}

What's solution?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦明 2024-12-05 03:16:09

您必须面对

  1. IE 的安全模型已更改的问题,并且使用本地文件路径的 window.open 恕我直言不再工作。另请参阅 尝试打开时 8.0 访问被拒绝本地文件
  2. 您的文件 uri 不正确。对于网络共享,它应该是 file:///C:/myfile.txt (不再起作用)或 file://server/share 。请参阅 http://blogs .msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx

为您要打开的文件夹创建网络共享。

You have to problems

  1. the security model of IE has changed and window.open with a local file path does IMHO not work anymore. See also Ie 8.0 Access Denied When Trying To Open Local Files
  2. Your file uri is not correct. It should be either file:///C:/myfile.txt (which doesn't work anymore) or file://server/share for a network share. See http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx

Create a network share for the folder you would like to open.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文