Welcome to Third Wish Sign in | Help
in
Home Headlines Forums Downloads

Write a comma seprated file

Last post 11-21-2006, 10:02 PM by Ken. 0 replies.
Sort Posts: Previous Next
  •  11-21-2006, 10:02 PM 10

    Write a comma seprated file

    I generally build my field with a cfloop query:

    <cfset str_myFile = "">
     
    <cfloop query="myQuery">
        <cfset str_myFile = "#str_myFile##Chr(10)#""#Field1#"",""#Field2#""">
    </cfloop>
     
    Then write it to a file:
     
    <cffile action="write" file="myFile.cdl" output="#str_myFile#">
     
    Then send it to them as a cdl file
     
    <cfcontent file="myFile.cdl" type="text/cdl">
     
    You'll have to check on the mimetype for the cdl file, not sure if that's correct. This method has worked for me on numerous occasions. You may have to play with the method you use to send the file, as some webservers treat the cfcontent deal a little differentlySmile

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems