5 Replies Latest reply on Feb 27, 2008 7:41 AM by JR "Bob" Dobbs-qSBHQ2

    cfcontent cfconfusion

    larry_schwartz Level 1
      When I use <cfcontent type="whatever/ext" file="somefile.ext"> in an action page called by a form, any code that follows cfcontent in the action page does not execute. In other words, cfcontent is acting like <cfabort>. the cfcontent tag is working exactly as expected, except it halts the code.

      Is there anything I can do about this?
        • 1. Re: cfcontent cfconfusion
          Level 7
          > When I use <cfcontent type="whatever/ext" file="somefile.ext"> in an action
          > page called by a form, any code that follows cfcontent in the action page does
          > not execute. In other words, cfcontent is acting like <cfabort>. the
          > cfcontent tag is working exactly as expected, except it halts the code.
          >
          > Is there anything I can do about this?

          I wouldn't have expected this to be the case, but it's certainly what I'm
          seeing too.

          I suppose the code monkeys at Allaire figured that CF's job in the mix is
          very "response-centric", and once the response has been finalised, there's
          no need to continue processing.

          I beg to differ here. Obviously once one's done the CFCONTENT, then that's
          it as far as OUTPUT goes, but there should be no reason why further
          processing shouldn't be allowed, just like if the last line which outputs
          text in a "normal" CFML template might be on line 10, but there might be 40
          lines of code after that. There's nothing wrong with *that*, is there? (He
          asks, rhetorically).

          I'd raise a bug / feature request if I was you.

          --
          Adam
          • 2. Re: cfcontent cfconfusion
            larry_schwartz Level 1
            At least I know I'm not doing anything wrong. I saw other posts on the web implying it's the tag and not my code.

            Any workarounds? I need to download a single file without displaying the file's URL. File exists on my server. I played around with cfhttp but couldn't figure out the technique.

            Thank you.
            • 3. Re: cfcontent cfconfusion
              JR "Bob" Dobbs-qSBHQ2 Level 3
              Larry,

              Could you post your code.
              • 4. cfcontent cfconfusion
                larry_schwartz Level 1
                Thank you for yourhelp.

                • 5. Re: cfcontent cfconfusion
                  JR "Bob" Dobbs-qSBHQ2 Level 3
                  You might use javascript to do two tasks.
                  1. open a new browser window for the file download
                  2. redirect to the relocation page

                  The problems with that approach:
                  1. depends on user having javascript enabled
                  2. might be interrupted by a pop up blocker