Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
jmoshier #1
MIMEtype and Cfheader/Cfcontent
Hello all,
We are using cfheader and cfcontent with a custom tag to hide the url of our
downloadable files. We also have an exception page set to email us if a cf
error occurs on any of our pages. The exceptions are set on the application
page then sends the user to the template, when an error occurs. Everything
seems to be working fine. There is just one glitch that I can't seem to figure
out. When a link that has a MIMEType of application/unknown, which
automatically goes to save the file to the desktop, is cancelled it triggers
the exception page to email that an error occured, but there really is no error.
Does anyone know of a way to stop the exception being triggered?
Thanks for your help in advance. I have attached the code I believe that is
needed to figure this all out.
jmoshier
<!---Custom tag that displays the files in the browser--->
<cfset variables.FileToPush=attributes.FilePath&attribute s.FileName>
<cfheader
name="content-disposition"
value="#attributes.DisplayType#; filename=#attributes.FileName#">
<cfcontent
type="#attributes.MIMEType#"
file=#variables.FileToPush#>
<!---These variables are needed in order to view/download a file--->
<cfparam name="URL.DisplayType" default="inline">
<!---I have a query that grabs all the information about the file--->
<!---code that actually pushesfile out--->
<cfif (GetFile.restricted EQ 1 AND
IsDefined("Session.ProductDocumentation_Username") AND
IsDefined("Session.ProductDocumentation_UserAuthor ization")) OR
GetFile.restricted EQ 0>
<!---Views/Downloads the file--->
<cfoutput query="GetFile">
<cf_push_file
FilePath=#variables.FilePath#
FileName=#file_name#
MIMEType=#MIMEType#
DisplayType=#URL.DisplayType#>
</cfoutput>
<cfelse>
<!---Send back to login page--->
<cflocation url="form_login.cfm?doc_id=#GetFile.doc_id#">
</cfif>
jmoshier Guest
-
problem downloading using CFCONTENT & CFHEADER
I am running into the same problem. Please reply if you find any fix to this problem. Thanks -
cfcontent ,cfheader download
i am sending an email to users in which there is a link for the coldfusion template , cfm page downloads the pdf file from the server , ... -
CFHEADER, CFCONTENT, Acrobat 6.0 and InternetExplorer problem...
Originally posted by: cf_menace This works perfectly with Acrobat 6.0 and MSIE 6.0. The key to getting the PDF plug-in to save the PDF as the... -
Using CFHeader and CFContent to control file downloads
I am programming a CF application for an online university. They need to be able to upload files to the server, and then authorize students... -
php mimetype
Hello, i'm try-ing to read the mimetype from a file located on the harddrive, but i have no clue how to do it. i have try-ing to seek it on the...



Reply With Quote

