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

cfcontent cfconfusion

New Here ,
Feb 26, 2008 Feb 26, 2008

Copy link to clipboard

Copied

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?
TOPICS
Advanced techniques

Views

446

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 ,
Feb 26, 2008 Feb 26, 2008

Copy link to clipboard

Copied

> 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

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
New Here ,
Feb 27, 2008 Feb 27, 2008

Copy link to clipboard

Copied

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.

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
Advisor ,
Feb 27, 2008 Feb 27, 2008

Copy link to clipboard

Copied

Larry,

Could you post your code.

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
New Here ,
Feb 27, 2008 Feb 27, 2008

Copy link to clipboard

Copied

Thank you for yourhelp.

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
Advisor ,
Feb 27, 2008 Feb 27, 2008

Copy link to clipboard

Copied

LATEST
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

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