Forum OpenACS Development: write an xml file

Collapse
Posted by Iuri Sampaio on
I wrote a script that creates a xml file.

With the command:
ns_return 200 application/octet-stream "?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?[$doc asXML -indent 2 -escapeNonASCII]"

I can offer to the user download the file through the browser.
Although i want the output to be written in a file located in a random directory i setup.

Does anyone know a script which i can take a look and replicate this little procedure on mine?

Collapse
2: Re: write an xml file (response to 1)
Posted by Iuri Sampaio on
Easier than i expected

set xml_content "?xml version=\"1.0\" encoding=\"UTF-8\"?[$doc asXML -indent 2 -escapeNonASCII]'"
set xml_filename "/var/lib/aolserver/trunk2/packages/photo-album/www/resources/xml/photos-temp.xml"
set fp [open $xml_filename w]
puts $fp $temp_iuri
close $fp

cheers!