admin管理员组文章数量:1391995
i am opening a file in IE6.0 from a directory using JavaScript. but iam getting 'Access is denied' error in javascript.My code in javascript
function poponload()
{
testwindow = window.open("C:\Searchtool\asd1.wrl", "mywindow", "location=1,status=1,scrollbars=1,width=300,height=300");
testwindow.moveTo(0,0);
}
if i use the same function from plain html page it is opening the page. But if i try to do the samething from ASP.NET2008(.ASPX page), i am getting 'access is denied' error. can anybody tell the reason why it is giving error? and Solution?
Thanks
i am opening a file in IE6.0 from a directory using JavaScript. but iam getting 'Access is denied' error in javascript.My code in javascript
function poponload()
{
testwindow = window.open("C:\Searchtool\asd1.wrl", "mywindow", "location=1,status=1,scrollbars=1,width=300,height=300");
testwindow.moveTo(0,0);
}
if i use the same function from plain html page it is opening the page. But if i try to do the samething from ASP.NET2008(.ASPX page), i am getting 'access is denied' error. can anybody tell the reason why it is giving error? and Solution?
Thanks
Share Improve this question edited Nov 23, 2009 at 12:47 Shoban 23k8 gold badges66 silver badges107 bronze badges asked Nov 23, 2009 at 12:41 SudhakarSudhakar 212 silver badges7 bronze badges4 Answers
Reset to default 6You are trying to access a file on the hard drive which you aren't allowed to do from a page from a web server.
It's a browser security feature. It won't allow you to directly access the hard drive from a web page. You can access it when you open an HTML file on the local system -- since the browser isn't granting you any more abilities than you already have, but allowing a web page to open a file on a local hard drive would be a huge security flaw.
The only way I know to do things like this are through trusted plugins/applets -- such as ActiveX or Java Applets. These need to be signed and/or have the user explicitly trust them with access to your system to get them to work.
If you are learning html and want a way to open pages in your machine from pages in your machine:
window.open("file:///C:/Searchtool/asd1.wrl", "mywindow", "location=1,
status=1,scrollbars=1,width=300,height=300");
better, put files in the same directory where is your web page.
本文标签: 39Access is denied39 Javascript errorStack Overflow
版权声明:本文标题:'Access is denied' Javascript error - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744586818a2614245.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论