![]() |
| Creating an XML file on the server |
|
Ennio
|
Is it possible to create an XML file with the information the user gives me, and save on the server?
|
||||||||||||
|
|
|||||||||||||
|
Jason101
Forum Regular
|
Sure Can..
It can be a query, form content, or anything at all..
If you are unfamiliar with cffile, here's the quickdocs http://www.cfquickdocs.com/?getDoc=cffile |
||||||||||||||
|
|
|||||||||||||||
|
Ennio
|
Jason that worked... thanks
one more question... now if I need to open the xml and make some updates here is the structure of my xml file..
I need to add now another item inside the playlist. |
||||||||||||||
|
|
|||||||||||||||
|
Jason101
Forum Regular
|
Just do the same thing, except add append to cffile...
This will open the file, and add to it. |
||||||||||||||
|
|
|||||||||||||||
|
Ennio
|
I got an error saying I can only have one top level.
I removed the <playlist> this is my top level and still get the error |
||||||||||||||
|
|
|||||||||||||||
|
Jason101
Forum Regular
|
Hmm.. You shouldn't get that kind of error unless you are specifically parsing the XML file. For all Coldfusion is concerned, you are just writing to a file. It doesn't care what you put in there.
Do you have a page where I can see the error? If not, can you post a screenshot and we'll go from there. |
||||||||||||
|
|
|||||||||||||
|
pmeserve
HostMySite Tech
|
Ennio - Is this file meant to be parsed by anything other than your script? If not, I'd highly recommend using a database to store data rather than XML - it would likely save you a lot of headaches
|
||||||||||||
|
|
|||||||||||||
|
Jason101
Forum Regular
|
I would agree with that. If you have an app that needs to read an xml file, you can just pull the data from the database and create on one the fly like you're doing above. |
||||||||||||||
|
|
|||||||||||||||
|
Ennio
|
Hi guys,...thanks for the advice... I did change to a DB
I was developing a flash mp3 player using xml, but I'm going to use a db. |
||||||||||||
|
|
|||||||||||||
| Creating an XML file on the server |
|
||
|


