Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Access denied for xml load

Reply
Thread Tools

Access denied for xml load

 
 
sean
Guest
Posts: n/a
 
      03-02-2004
var strPath = "c:\myXml.xml";

var objDom = new ActiveXObject("Msxml2.DOMDocument");
alert('step 1');
objDom.load(strPath);
alert('step 2');
................

AFTER step 1 I'm getting an errorrrrrrrrrrrr. Im just going crazy.
Error: Access denied!


Yes, if I put strPath like : http://somehost/myXml.xml it is going to
work.
But I need the user to be able to pick up this xml with an <input
type=file>.
It won't be any upload, invloved, just read the damn path to the xml
and load the xml. WHY is this happen?

Thanks!
 
Reply With Quote
 
 
 
 
Dag Sunde
Guest
Posts: n/a
 
      03-03-2004
Because JavaScript in a client-browser is running in
a "sandbox", and won't let you out as long as you
don't sign your scripts.

objDom.load("C:\..."); are accessing the local file-system.
Javascript are *only* allowed to access files on the
server it originated.

(And thank God for that!)


If you really need this functionality, I would recommend
that you contact Thawte or VeriSign to get yourself a
Code Signing certificate, and convince your users to accept and
install your certificate when they access your page.

Signed Scripts *can* access local files.

--
Dag.


"sean" <> wrote in message
news: m...
> var strPath = "c:\myXml.xml";
>
> var objDom = new ActiveXObject("Msxml2.DOMDocument");
> alert('step 1');
> objDom.load(strPath);
> alert('step 2');
> ...............
>
> AFTER step 1 I'm getting an errorrrrrrrrrrrr. Im just going crazy.
> Error: Access denied!
>
>
> Yes, if I put strPath like : http://somehost/myXml.xml it is going to
> work.
> But I need the user to be able to pick up this xml with an <input
> type=file>.
> It won't be any upload, invloved, just read the damn path to the xml
> and load the xml. WHY is this happen?
>
> Thanks!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Very annoying error: Access to the path is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity Jay ASP .Net 2 08-20-2007 07:38 PM
Could not load file or assembly 'System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Access is denied Ken ASP .Net 0 05-05-2007 12:30 AM
403 Forbidden: You were denied access because: Access denied by access control list Southern Kiwi NZ Computing 6 03-19-2006 05:19 AM
Access Denied following Assembly.Load =?Utf-8?B?SnVzdGlu?= ASP .Net 0 10-26-2005 01:33 PM
Problem with xml.load & xsl.load in JSP David Shen Javascript 0 08-28-2003 06:12 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57