RE: Difference between cfcontent and cfheader in terms its usage?

2012-02-16 Thread Bobby Hartsfield

as the names suggest, cfheader is for creating HTTP response headers and
cfcontent is for sending mime encoded content (generally that of a file).
cfcontent can set the mime content header but it's the only header it sets.

http://cfdocs.org/cfheader

http://cfdocs.org/cfcontent


.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
http://cf4em.com



-Original Message-
From: Jay Pandya [mailto:jaypandy...@gmail.com] 
Sent: Thursday, February 16, 2012 2:01 AM
To: cf-talk
Subject: Difference between cfcontent and cfheader in terms its usage?


Difference between cfcontent and cfheader in terms its usage? 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349923
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Difference between cfcontent and cfheader in terms its usage?

2012-02-15 Thread Justin Scott

 Difference between cfcontent and cfheader in terms its usage?

Generally, cfcontent is used to serve up a file from the server
through ColdFusion (could be a generated PDF document, tracking image,
or any other file you want to have ColdFusion serve up for you through
the code).  You can also use cfcontent to specifically set the
content-type header through the type attribute (usually in
conjunction with a file to be sent with the file attribute).  It can
also be used to reset the output buffer as long as output hasn't been
flushed back to the server yet.

The cfheader tag is used to set specific response headers or status
codes for the HTTP request.  This can be used to set the status code
and one or more response headers as needed.  It's commonly used to set
a Content-Disposition header in conjunction with the cfcontent tag
when serving up a file to give the client a hint as to what filename
it should use for the file being served.  It can be used to set a
Location header (which was common in conjunction with a 301 status
code in earlier versions of ColdFusion, or in conjunction with setting
a cookie way back before the cflocation tag was fixed in this regard).


-Justin

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349908
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm