1 Reply Latest reply on Mar 20, 2008 10:54 AM by Newsgroup_User

    redirect after using cfheader/cfcontent

      I have a file that a user is prompted to download using

      value="attachment; filename=ProPlannerRevenueTemplate.xls" />

      file="#ExpandPath( './download_templates/ProPlannerRevenueTemplate_#Left(Hash(session.client_id), 15)#.xls' )#"
      deletefile="yes" />

      Afterwards, I want to redirect the user to another page, but the <cflocation> tag I have after this doesn't seem to execute. Any ideas on how to restructure this so that it will work?
        • 1. Re: redirect after using cfheader/cfcontent
          Level 7
          I do not think you can do these two operations with the same request. A
          <cflocation...> works by sending a client a HTTP status of 302 FOUND
          (Moved Temporarily). If the client acted on this status it would move
          to the specified URL and not download the file. OR it does not act on
          this status and receives this response.

          What you are attempting to do, is probably best done with some client
          side code. That uses JavaScript to relocate the client once this
          response is received.

          Why this is not currently relocating and sending the file is probably
          because of the default reset="yes" parameter of the <cfcontent...> tag
          that discards any response generated before the tag.