Question
CFCONTENt & HTTPS
Hi, i'm having a problem migrating some CF5 code to MX7.
We have a page (code below) which runs perfetly fine on CF5 and on MX7
throws an error "Internet Explorer cannot download disp_displaydoc.cfm
from blah blah blah" We have managed to narrow the problem down to the
page being served over HTTPS as it works ok on normal HTTP.
We really need this to run over SSL and wondered if anyone had any
ideas on how we can serve these docs/pdfs etc. as before.
Thanks for your help, Ally
--------------------------------------------------------
cfsilent>
<cfscript>
function udfFileMimeType(sFilename)
{
var sMime = "";
var sExt = lcase(right(sFilename,3));
switch(sExt)
{
case "csv": { sMime = "text/comma-separated-values";break;
}
case "doc": { sMime = "application/msword";break; }
case "htm": { sMime = "text/html";break; }
case "mdb": { sMime = "application/msaccess";break; }
case "mov": { sMime = "video/quicktime";break; }
case "pdf": { sMime = "application/pdf";break; }
case "ppt": { sMime = "application/powerpoint";break; }
case "rtf": { sMime = "application/rtf";break; }
case "txt": { sMime = "text/plain";break; }
case "xls": { sMime = "application/excel";break; }
case "xml": { sMime = "application/xml";break; }
case "zip": { sMime = "application/zip";break; }
default: { sMime = "application/unknown";break; }
}
Return sMime;
}
</cfscript>
<cfparam name="URL.DIR" default="docs">
<cfset thisFile = URLDecode(URL.file)>
<cfheader name="content-disposition" value='inline;
filename="#thisFile#"'>
<CFCONTENT file="#application.PSsavepath#\#URL.dir#\#thisFile#"
TYPE="#udfFileMimeType(thisFile)#">
</cfsilent>
We have a page (code below) which runs perfetly fine on CF5 and on MX7
throws an error "Internet Explorer cannot download disp_displaydoc.cfm
from blah blah blah" We have managed to narrow the problem down to the
page being served over HTTPS as it works ok on normal HTTP.
We really need this to run over SSL and wondered if anyone had any
ideas on how we can serve these docs/pdfs etc. as before.
Thanks for your help, Ally
--------------------------------------------------------
cfsilent>
<cfscript>
function udfFileMimeType(sFilename)
{
var sMime = "";
var sExt = lcase(right(sFilename,3));
switch(sExt)
{
case "csv": { sMime = "text/comma-separated-values";break;
}
case "doc": { sMime = "application/msword";break; }
case "htm": { sMime = "text/html";break; }
case "mdb": { sMime = "application/msaccess";break; }
case "mov": { sMime = "video/quicktime";break; }
case "pdf": { sMime = "application/pdf";break; }
case "ppt": { sMime = "application/powerpoint";break; }
case "rtf": { sMime = "application/rtf";break; }
case "txt": { sMime = "text/plain";break; }
case "xls": { sMime = "application/excel";break; }
case "xml": { sMime = "application/xml";break; }
case "zip": { sMime = "application/zip";break; }
default: { sMime = "application/unknown";break; }
}
Return sMime;
}
</cfscript>
<cfparam name="URL.DIR" default="docs">
<cfset thisFile = URLDecode(URL.file)>
<cfheader name="content-disposition" value='inline;
filename="#thisFile#"'>
<CFCONTENT file="#application.PSsavepath#\#URL.dir#\#thisFile#"
TYPE="#udfFileMimeType(thisFile)#">
</cfsilent>
