Access denied for xml load

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sean

    Access denied for xml load

    var strPath = "c:\myXml.x ml";

    var objDom = new ActiveXObject(" Msxml2.DOMDocum ent");
    alert('step 1');
    objDom.load(str Path);
    alert('step 2');
    ............... .

    AFTER step 1 I'm getting an errorrrrrrrrrrr r. 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!
  • Dag Sunde

    #2
    Re: Access denied for xml load

    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" <jackie_sean@ya hoo.se> wrote in message
    news:d96513dd.0 403021440.3700c 45@posting.goog le.com...[color=blue]
    > var strPath = "c:\myXml.x ml";
    >
    > var objDom = new ActiveXObject(" Msxml2.DOMDocum ent");
    > alert('step 1');
    > objDom.load(str Path);
    > alert('step 2');
    > ...............
    >
    > AFTER step 1 I'm getting an errorrrrrrrrrrr r. 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![/color]


    Comment

    Working...