6 Replies Latest reply on Feb 27, 2009 5:50 AM by apocalipsis19

    CFContent Situation

      Hello community!

      I am working on an export file which is a pipe (|) delimited file and I am running into some issues. First of all the file is not being generated with the file name that I am specifying. Second, I am getting a ton of HTML in addition to my data in my generated file. I want a clean export -That is only the data from my query. This export is for a third party product that we use in my company.

      This is where I generate the file:

      <cfcontent type="text/plain">
      <cfheader name="Content-Disposition" value="\\development\webdata\retail\cigars\filename=famoussmoke_#timeNow#.txt">
      <br />
      <cfloop query="getFields">

      #adr#|#fname#|#lname#|#zip#|#ordnum#|#tot_goods#|#suppflgs#<br />

      Can somebody provide me with some assistance?

        • 1. CFContent Situation
          JR "Bob" Dobbs-qSBHQ2 Level 3
          Things to try:

          For a text file use Chr(13) & Chr(10) instead of a BR tag.

          You will also need to remove whitepace prior to your content by using reset="yes" in your CFCONTENT tag. Also remove any whitespace such as line breaks after your CFCONTENT tag.

          I think your CFHEADER tag is also a problem. Are you trying to download the text to your browser or save it to a file share?

          Edit: Modified code sample.
          • 2. Re: CFContent Situation
            Level 7
            First, I *think* you want to put the <cfheader> before the
            <cfcontent...> tag, but I am not user.

            But definatly, if you do not want HTML in your output, don't put it
            there! You are formating you content as HTML with <br/> and such, but
            then telling the browser that it is not HTML with the type="text/plain".
            Go one way or the other, don't mix the message.

            <cfcontent type="text/plain">

            NOTE: It is very hard to experss in this email, but since you are
            saying this output is plain text, not HTML, then all white space is
            going to count. So you will have to be very careful with what you put
            in and around your <cfoutput...> tags. They will show up!
            • 3. Re: CFContent Situation
              apocalipsis19 Level 1
              Hi JR!

              Yes, I want to download the file to my desktop. It's not being downloaded with the name I specified though..........See cfheader tag...Thanks soooo much!
              • 4. Re: CFContent Situation
                JR "Bob" Dobbs-qSBHQ2 Level 3
                See attached sample. Note that the attachment value for Content-Disposition is only recognized by some browsers, such as Internet Explorer.
                • 5. Re: CFContent Situation
                  apocalipsis19 Level 1
                  Ok, let me try the other way around and I will post in here how it goes!
                  • 6. Re: CFContent Situation
                    apocalipsis19 Level 1
                    The problem was here:


                    I didn't have the word attachment in the value paramater.

                    Thank you guys! Your feedback and support were awesome!