Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Sep 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to i write an asp file that allows me to create a new xml file on the c:/

    hi guys.... how to i write an asp file that allows me to create a new xml file on the c:/ with processing instruction and tags like

    <?xml version="1.0"?>
    <content>
    <title></title>
    <s-title></s-title>
    <p1></p1>
    <p2></p2>
    <image><image>
    <p3></p3>
    <image1></image1>
    </content>

    Also, how do i write a html form that allows me to write value to these tags calling to this asp file and update it on c:/ when i click on a submit button....??

    I realli need urgent help on this but i realli dunno how to do so..becoz i am realli an idiot in asp....

    Thx...

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Location
    Bulgaria
    Posts
    123
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,
    The main problem will not be the ASP code...
    Usually ASP runs with the so called internet guest account, so it's rare that it has write permissions even under the web root... As of the drive root...
    You have 3 options to allow this:
    1. Set up a web site whichs root is c:\. And don't forget to set NTFS permissions to allow 'change' for IUSR_mashine_name account. Very, very risky....
    2. Set up a site and disallow IIS to manage password for anonimous access. Impersonate anonimous user with some account that have the rights to write in c:\. If You set up well Your site security, this is not so dangerous...
    3. Let the site rely only on integrated windows security. In this case the user that launches the ASP will have to be logged in the same domain and, sure have the rights to write in c:\

    A question - It will be much more easy if the destination folder is somewhere under the webroot. Are You sure You need c:\ explicitely?

    Alex

  • #3
    New Coder
    Join Date
    Sep 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts
    actually i have managed to create a new xml file in c:/ but my prob is how do i actually write the html form file that can add values to each of the tags...?

    my asp script is as follow:
    <%
    dim objdom
    set objdom=server.CreateObject("Msxml2.domdocument")
    dim objelm
    dim objPI
    set objPI=objdom.createProcessingInstruction("xml","version=""1.0""")
    objdom.appendChild objPI
    ' create Processing instruction
    set objelm=objdom.createElement("content")

    objdom.appendChild objelm

    set objelm=objdom.createElement("title")

    objdom.documentElement.appendChild objelm

    set objelm=objdom.createElement("s-title")

    objdom.documentElement.appendChild objelm

    set objelm=objdom.createElement("p1")

    objdom.documentElement.appendChild objelm

    set objelm=objdom.createElement("p2")

    objdom.documentElement.appendChild objelm

    set objelm=objdom.createElement("image")

    objdom.documentElement.appendChild objelm

    set objelm=objdom.createElement("p3")

    objdom.documentElement.appendChild objelm

    set objelm=objdom.createElement("image1")

    objdom.documentElement.appendChild objelm




    objdom.save "C:\WINDOWS\Desktop\alvin\myproj\New Folder (2)\New Folder\createTest.xml"

    %>


    is there any error wif this asp file? how to write the html form..?

  • #4
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,461
    Thanks
    1
    Thanked 23 Times in 21 Posts
    Cross-posted:
    http://www.codingforums.com/showthre...?threadid=6922

    wanye, I moved this thread to HTML before checking to see if it was in ASP forum. That is now the third thread you have posted to multiple forums.

    http://www.codingforums.com/postguide.htm
    Last edited by Alex Vincent; 09-28-2002 at 03:05 AM.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • #5
    WA
    WA is offline
    Administrator
    Join Date
    Mar 2002
    Posts
    2,596
    Thanks
    2
    Thanked 19 Times in 18 Posts
    wanye, as Alex has mentioned, do NOT cross post. Doing so makes it so much more confusing and of a hassle to help out. Please conisder this your final warning.
    - George
    - JavaScript Kit- JavaScript tutorials and 400+ scripts!
    - JavaScript Reference- JavaScript reference you can relate to.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •