• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

redirect after using cfheader/cfcontent

Explorer ,
Mar 20, 2008 Mar 20, 2008

Copy link to clipboard

Copied

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

<cfheader
name="content-disposition"
value="attachment; filename=ProPlannerRevenueTemplate.xls" />

<cfcontent
type="image/jpeg"
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?
TOPICS
Advanced techniques

Views

923

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 20, 2008 Mar 20, 2008

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation