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 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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.