I am trying to open a file from aspx page using java script. I am using window.open("file:////c:\\inetpub\wwwroor\MyFiles\mydoc.xps") in my java script to open the xps document. At this line of code, the debugger is throwing ACCESS DENIED exception. Am I
missing some thing here? I am running IIS 5.1 and I gave IIS process account and ASPNET Account full control n the MYFILES folder.
Javascript is client side script, when you are using window.open(file:////c:\\inetpub\wwwroor\MyFiles\mydoc.xps), browser will try to open the file from browser pc local resource, not server local
resource.
I tried using the relative URLS in my code. But, I am sending my URL to the javascript function to open the file. For example: I am sending the URL parameter for my javascript as: C:\inetpub\wwwroot\MyFiles\mydoc.xps, I see in the debugger that, the back
slash is removed and the value turns into C:inetpubwwwrootMyFilesmydoc.xps. I have no idea why this is happenning. Please advice and I still have the ACCESS DENIED exception.
hr3
Member
15 Points
32 Posts
ACCESS DENIED exception when opening a file in IIS virtual directory from aspx page.
Nov 19, 2012 12:43 AM|LINK
Hi all,
I am trying to open a file from aspx page using java script. I am using window.open("file:////c:\\inetpub\wwwroor\MyFiles\mydoc.xps") in my java script to open the xps document. At this line of code, the debugger is throwing ACCESS DENIED exception. Am I missing some thing here? I am running IIS 5.1 and I gave IIS process account and ASPNET Account full control n the MYFILES folder.
Thanks in advance....
oned_gk
All-Star
31373 Points
6412 Posts
Re: ACCESS DENIED exception when opening a file in IIS virtual directory from aspx page.
Nov 19, 2012 01:12 AM|LINK
Javascript is client side script, when you are using window.open(file:////c:\\inetpub\wwwroor\MyFiles\mydoc.xps), browser will try to open the file from browser pc local resource, not server local resource.
hr3
Member
15 Points
32 Posts
Re: ACCESS DENIED exception when opening a file in IIS virtual directory from aspx page.
Nov 19, 2012 01:46 AM|LINK
I tried using the relative URLS in my code. But, I am sending my URL to the javascript function to open the file. For example: I am sending the URL parameter for my javascript as: C:\inetpub\wwwroot\MyFiles\mydoc.xps, I see in the debugger that, the back slash is removed and the value turns into C:inetpubwwwrootMyFilesmydoc.xps. I have no idea why this is happenning. Please advice and I still have the ACCESS DENIED exception.
hr3
Member
15 Points
32 Posts
Re: ACCESS DENIED exception when opening a file in IIS virtual directory from aspx page.
Nov 19, 2012 02:14 AM|LINK
I got the URL correct in the paramter now. But, I still have the ACCESS DENIED exception. Is there a way to get over it.
oned_gk
All-Star
31373 Points
6412 Posts
Re: ACCESS DENIED exception when opening a file in IIS virtual directory from aspx page.
Nov 19, 2012 03:03 AM|LINK
Maybe
window.open("http://....../yourapp/MyFiles/mydoc.xps")