Ask a Question related to Coldfusion Database Access, Design and Development.
-
shenry #1
cfthrow/cfcatch
Is the code after <cfthrow> supposed to execute? If my page, I have code
after the <cfthrow> that I don't want to execute.
How do I stop this from happening?
<CFTRY>
<cffile action="UPLOAD" filefield="#fileNum#"
destination="#LibraryDirectory#" nameconflict="MAKEUNIQUE">
<cfif Find(" ", File.ServerFile) OR Find("&", File.ServerFile)>
<cfset newfilename = Replace(File.ServerFile, " ", "", "ALL")>
<cfset newfilename = Replace(newfilename, "&", "", "ALL")>
<cffile action="RENAME" source="#LibraryDirectory##File.ServerFile#"
destination="#LibraryDirectory##newfilename#">
<cfelse>
<cfset newfilename = "#File.ServerFile#">
</cfif>
<cfif file.ServerFileExt IS NOT "pdf" OR NOT ISDefined("file.ServerFileExt")
OR NOT FIND("pdf", newfilename, 1)>
<cfthrow message="The MIME type of the uploaded file, '#file.ContentType#',
was not accepted by the server." type="file.contentType" detail="Only files of
type 'application/pdf' can be uploaded.">
</cfif>
--- other code --
<CFCATCH TYPE="file.ContentType">
</CFCATCH>
</CFTRY>
shenry Guest
-
Flash Remoting and CFTHROW
We are using FlashRemoting and CF7. And are experiencing a weird problem. If we use a variable in the <cfthrow> message attribute, the exception... -
cfdump on cfcatch
sometimes i can successfully cfdump the cfcatch variable. other times, when I try to dump it, it says "unknown type". any ideas what's up with... -
Using CFTHROW to catch invalid email addresses
I'm working on a helpdesk system that sends notification emails to users and support consultants whenever they updated certain fields in the forms.... -
Cfcatch include
I have a cfcatch routine that I am including in my forms that emails the administrator when an error occurs. I would like to have this code in a... -
<CFTRY> <CFCATCH>
I would like to know whether there's a way to obtain the SQL statement via cfcatch's like I see when I use cferror or default to the error message. ... -
BKBK #2
Re: cfthrow/cfcatch
In this excerpt, if testBooloean is true, code block B will run and code block A
will not; if testBooloean is false, code block A will run and code block B
will not.
<CFTRY>
<cfif testBoolean>
<cfthrow message="x" type="y">
</cfif>
<!--- code block A --->
<CFCATCH TYPE="y">
<!--- code block B --->
</CFCATCH>
</CFTRY>
BKBK Guest
-
Dan Bracuk #3
Re: cfthrow/cfcatch
Your cfthrow is inside a cfif tag. How do you know it is actually running?
Originally posted by: shenry
Is the code after <cfthrow> supposed to execute? If my page, I have code
after the <cfthrow> that I don't want to execute.
How do I stop this from happening?
Dan Bracuk Guest
-
shenry #4
Re: cfthrow/cfcatch
I know it's running, because I put a <cfmail> tag inside the <cfcatch> and I'm getting the emails.
I solved the problem by putting a <cfabort> right before </cfcatch>.
Thanks for your responses.
shenry Guest



Reply With Quote

