Create Files on the Fly in ColdFusion
page 5 of 6
by Sarita Mishra
Feedback
Average Rating: 
Views (Total / Last 10 Days): 33837/ 36

Creating .XML file

Steps

1) The change in the type of the file to be created in CFCONTENT TYPE tag will solve this problem. Here it is XML type.

<CFHEADER NAME="Content-Disposition" VALUE="INLINE; FILENAME=filename.xml">
<CFCONTENT TYPE="application/XML"  DELETEFILE="yes">

Deletefile=”yes” will delete the files from the directory after sending it to the client.  If a user wants to be prompted with an option to save the file or open it in the browser then the value="inline will solve this.

Listing 6

  <CFHEADER NAME="Content-Disposition" VALUE="INLINE; FILENAME=test.xml">
  <CFCONTENT TYPE="application/XML"  DELETEFILE="yes"> 
       <Book>
       <Author>Abraham Linkon</Author>
       <Price>Rupees 500</Price>
       </Book>

This will create an .xml file which can be opened in a browser and can be used independently in subsequent ColdFusion pages as ordinary .xml files.


View Entire Article

User Comments

Title: great   
Name: Sandy
Date: 2006-11-02 6:33:11 AM
Comment:
Great job.. keep moving ahead
Title: Kar   
Name: Chandrakanta
Date: 2006-11-01 2:56:09 AM
Comment:
It is very nice and can also helpful for the new developers. Come across creating different file formats at the time of requirement.
Title: Great Job   
Name: pd
Date: 2006-11-01 2:41:58 AM
Comment:
Keep it up.
Title: Nice Article   
Name: Tom Anderson
Date: 2006-10-31 1:46:13 AM
Comment:
Very Nice and informative article for people working on ColdFusion.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-03-29 6:46:04 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search