开发者

Open Folder on IE using javascript (CRM 4.0)?

开发者 https://www.devze.com 2023-03-25 23:54 出处:网络
I wan开发者_开发知识库t 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.

I wan开发者_开发知识库t 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消