>a file into a page's output? Let's say I want to allow users to upload
>plain HTML in a freely-coded form, and want to CFINCLUDE it in my pages.
>
>CFINCLUDE will compile, and process it which is not what I want.
>
>I can always CFFILE read it and cfoutput the content, but that's not
>performant, since it loads the entire buffer into memory. What I really
>want (and will write the code obviously, if i need to) is a
>java.io.bufferedreader to send line by line of a file to the page's output
>buffer. That would be a really nice extension to cfml IMHO...
>
>Is there a cf tag for this already? Could I use CFCONTENT in the middle of
>my pages without resetting headers to accomplish this? (is that the
>recommended solution)?
>
If you're using MX (or BlueDragon), you can use the
getPageContext().include() function to prevent the CF parser from doing its
thing. For example, I have an article system where the article body is an
HTML file included in a ColdFusion template (which does tracking, security
checks, etc.). Where I'd want to include the HTML file, I simply put:
<cfset
getPageContext().include("/article_bodies/#Variables.article_body_file_name#")
/>
and the CF parser won't touch it. I have no idea at all if this works with
other file extensions, but I know it ignores HTML. In the interest of full
disclosure, I picked this tip up from Matt Liotta a while back.
Regards,
Dave.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

