Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resume after CFFILE error?

Status
Not open for further replies.

bobbyr

Programmer
Nov 30, 2000
66
US
I'm using CFFILE to delete a file from a directory. How can I keep processing the page(ignore an error) if the file that it tries deleting isn't there?
 
You can do this one of two ways.

You can use <cftry> which is an error catching function or you can just use the fileexists() function to make sure the file is there before you delete it. It's technically possible although very unlikely that the file could be deleted after checking it with fileexists but before deleting it with cffile. This would cause an error but would be very unlikely. In my opinion, <cftry> gives you the safest way to guarantee errors won't stop your page.

GJ
 
<cftry> is exactly what I was looking for. Thanks GunJack!

Bobby R

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top