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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hoe to check if file exists before I use CFFILE DELETE

Status
Not open for further replies.

Newbiesome

Programmer
Feb 5, 2004
3
US
I have a problem checking if a file that was uploaded ages ago still exists before a user deletes it.

The user can select multiple check boxes for what records get deleted. The file name is stored in a database along with the record. Ideally the file associated with that record should always be there but if the file is not there, the application stops the deletion process.

It seems the CFFILE action does not just detect a file that I can see.

 
Try wrapping your CFFILE tag with CFTRY and CFCATCH tags, that way it will try to delete it, and if it's not there it won't crash.



Hope This Helps!

Ecobb

"Alright Brain, you don't like me, and I don't like you. But lets just do this, and I can get back to killing you with beer." - Homer Simpson
 
Thank you.

"I don't know why I did it, I don't know why I enjoyed it, and I don't know why I'll do it again..."

- Bart Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top