Skip to main content
Known Participant
May 20, 2006
Answered

Using CFCONTENT to deliver word document

  • May 20, 2006
  • 5 replies
  • 639 views
website: http://www.datafusionsystems.com/ Click on link to download resume. You will see it downloads it as index.cfm.
Here is the code I am using.

<cfif isdefined("URL.downloadresume")>
<cfcontent file="c:\domains\datafusionsystems.com\wwwroot\noah_britton_resume.doc" type="application/msword" deletefile="no">
</cfif>

I have no idea why it is behaving strangely. I'm not using CFHEADER of CFCACHE on this page. Thanks!
This topic has been closed for replies.
Correct answer BKBK
You should use both tags, cfcontent and cfheader. It is also a good idea to check beforehand whether the file exists.

5 replies

Known Participant
May 20, 2006
Ah I get it, thanks. It works beautifully now!
BKBK
Community Expert
BKBKCommunity ExpertCorrect answer
Community Expert
May 20, 2006
You should use both tags, cfcontent and cfheader. It is also a good idea to check beforehand whether the file exists.

Inspiring
May 20, 2006
add that to your cfif statement along with the cfcontent tag
you have to use both.
hth
--
Tim Carley
www.recfusion.com
info@NOSPAMINGrecfusion.com
Known Participant
May 20, 2006
I've implemented the first example you gave on my site but the downloaded file is a copy of my webpage, not my word document. Here is the code

<cfheader name="content-disposition"
value="attachment;filename=noah_britton_resume.doc">

Go to www.datafusionsystems.com to try it out and see for yourself. Thanks for the try though, hope i get this resolved.
Inspiring
May 20, 2006
<cfheader name="content-disposition"
value="attachment;filename=noah_britton_resume.doc">
or
<cfheader name="content-disposition"
value="inline;filename=noah_britton_resume.doc"> to display in browser.
HTH
--
Tim Carley
www.recfusion.com
info@NOSPAMINGrecfusion.com