PDA

View Full Version : saving xml file under different file names in c:/ using asp??


wanye
09-27-2002, 03:06 PM
hi all, how to save an xml file under different file names in c:/ using asp without hardcoding the file name in asp?
Eg. user inputs desired file name through a form, click on submit and the xml file will be saved under the desired file name in c:/. how to do that? i need help on that badly....! thx..

whammy
09-27-2002, 11:54 PM
http://www.w3schools.com/asp/asp_ref_textstream.asp

wanye
09-28-2002, 01:59 AM
hi whammy..sry to trouble u ...as i dun quite understand ref textstream is all abt.. can u give me a more simple example abt how to save an xml file under different file names in c:/ using asp without hardcoding the file name in asp?

dagaffer
09-28-2002, 03:34 PM
hey, do u no if u can change the code given in
http://www.w3schools.com/asp/asp_ref_textstream.asp
for it to work with a free brinkster website?

whammy
09-28-2002, 04:42 PM
In order to get it to work on brinkster, you need to map the path of the file to

\database\filename.txt

using Server.MapPath(), since that's the only folder with write permissions.

As far as helping you more, Wanye, I'd need to learn more of what you are trying to accomplish - as the link I gave you shows how to create files, and being VBScript, of course you can use a variable to name them, so it would be easy to name them however you want (from form input, date, etc.)...

wanye
09-28-2002, 04:58 PM
hey, whammy.....can u plz show me an example of the script of how user inputs his desired filename in the textfield of the form and when he clicks submit... the filename will be append to the script....becoz by rite.. when i use asp to save an xml to hard disk... the filename will be hardcoded in the script... but i dun want that...what i want is to save this same xml file under different filenames according to what the user input thru the form....

whammy
09-28-2002, 05:17 PM
That's as simple as using Request.Form("variablename") - if you're not familiar with that (as it's about the first thing you learn in ASP), I'd suggest a couple of tutorials:

http://www.liquidrage.com
http://www.haneng.com
http://www.aspalliance.com

:)