Skip navigation
Currently Being Moderated

cfcontent IIS and particular mime types

Jun 10, 2012 3:01 PM

Tags: #video #cfcontent #iis6

I have an application this is using flowplayer to play various video files. The video files are passed to flowplayer using a cfm script with the cfcontent tag. What I am finding is that for some file types this process fails; the player hangs and the video doesn't play. An example file type is mp4. The problem is specific to our server running IIS 6. On my local box I have Apache installed and the script works fine for mp4 files. I have the mp4 mime type defined in IIS 6 as "video/mp4" and that is what I use in the type attribute of the cfcontent tag. (I've also tried "video/mpeg" without success.) If I change my process so that I pass the file directly to flowplayer then it plays fine on IIS 6. Here is the basic code I have for providing the file.



<cfdirectory directory="#fileDir#" action="list" filter="#getAllFileInfoRet.result.file_name#" name="dirFileInfo" />

<cfif dirFileInfo.recordcount gt 0>

    <cfheader name="Content-Length" value="#dirFileInfo.size#">


<cfheader name="Expires" value="Thu, 19 Nov 1981 08:52:00 GMT">

<cfset tz = GetTimeZoneInfo() />

<cfset gmtNow = DateAdd("h",tz.utcHourOffset,Now()) />

<cfheader name="Last-Modified" value="#DateFormat(gmtNow,"ddd, d mmm yyyy")# #TimeFormat(gmtNow,"hh:mm:ss")# GMT">

<cfheader name="Content-Disposition" value="attachment;filename=#getAllFileInfoRet.result.file_name#">

<cfheader name="Content-Type" value="#getAllFileInfoRet.result.file_ext_mime#">

<cfheader name="Cache-Control" value="no-store, no-cache, must-revalidate, post-check=0, pre-check=0">

<cfheader name="Pragma" value="no-cache">

<cfcontent deletefile="false" file="#fileDir##getAllFileInfoRet.result.file_name#" type="#getAllFileInfoRet.result.file_ext_mime#" />



I've tried various combinations of the cfheader tags without having any effect. If anyone has some suggestions or has encountered something similar, I'll take whatever help I can get.


More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points