'Access is denied' Javascript error - Stack Overflow

i am opening a file in IE6.0 from a directory using JavaScript.but iam getting 'Access is denied&

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 badges
Add a ment  | 

4 Answers 4

Reset to default 6

You 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744586819a4582360.html

相关推荐

  • 'Access is denied' Javascript error - Stack Overflow

    i am opening a file in IE6.0 from a directory using JavaScript.but iam getting 'Access is denied&

    2天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信