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

09-27-2002, 10:09 AM
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"?>

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


09-27-2002, 12:06 PM
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?


09-27-2002, 12:35 PM
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..?

Alex Vincent
09-28-2002, 02:51 AM

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.


09-28-2002, 03:35 AM
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.