Skip to main content
lovewebdev
Inspiring
January 28, 2010
Question

<cfcontent> to send any file type

  • January 28, 2010
  • 2 replies
  • 487 views

I currently use this to serve a download

<cfcontent type="image/gif" file="F:\main\site.com\userfiles\#getfileinfo.fileid#.gif">

Is there a way to use this to serve any kind of file. This way I have to specify the file type, but it may change.

This topic has been closed for replies.

2 replies

BKBK
Community Expert
Community Expert
January 30, 2010
<cfcontent> to send any file type

Specify the file attribute, but leave out type attribute. That forces Coldfusion to make an intelligent guess for the type.

Inspiring
January 28, 2010

Um... well you could use a variable instead of hard-coding the MIME type?

Or am I not understanding what you're asking, because that sounds like too obvious a suggestion to me?

--

Adam