Hi Michael,

Thanks for the example. My case it's a little bit different. I get the
info from a db call and want to allow the user to download it as an
excel file. And it works fine in stand alone mode but when invoked
through jQuery the cfcontent is ignored.
So I had to manually open another window which will trigger the download.

Thanks
Victor

On Tue, Oct 12, 2010 at 1:47 PM, Michael Grant <mgr...@modus.bz> wrote:
>
> Here's a working example:
>
> <!--- Read the file --->
> <cffile action = "read"  file = "/seedRequests.xls"  variable = "xlsXML">
>
> <!--- Set content-dispostion --->
> <cfheader name="Content-disposition" value="attachment;
> filename=seedRequests.xls" />
>
> <!--- feed the file to the browser --->
> <cfcontent type="application/unknown" variable="#ToBinary( ToBase64(
> xlsXML.Trim().ReplaceAll( '>\s+', '>' ).ReplaceAll( '\s+<', '<' ) ) )#" />

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

Reply via email to