Thanks Will, that's great -----Original Message----- From: Will Swain [mailto:w...@hothorse.com] Sent: 25 September 2009 10:08 To: cf-talk Subject: RE: cffile action="delete" problems
Your query needs a name - so you can refer to it later. <CFQUERY DATASOURCE="#Application.DSN#" NAME="qGetDocument"> SELECT * FROM documnents WHERE docid = <CFQUERYPARAM CFSQLTYPE="CF_SQL_INTEGER" Value="#docid#" maxlength="4"> </CFQUERY> Assuming the filename is docname, and your file lives in F:\downloads\: <cffile action="delete" file="F:\downloads\#qGetDocument.docname#"> -----Original Message----- From: Ian Vaughan [mailto:i.vaug...@neath-porttalbot.gov.uk] Sent: 25 September 2009 10:00 To: cf-talk Subject: cffile action="delete" problems Hi I have the following script that removes a record from a database. This database record contains document information i.e. docid, docname, docpath etc. <CFQUERY DATASOURCE="#Application.DSN#"> SELECT * FROM documnents WHERE docid = <CFQUERYPARAM CFSQLTYPE="CF_SQL_INTEGER" Value="#docid#" maxlength="4"> </CFQUERY> However how can I modify the above so it actually removes the document from the filesystem? At present it only removes the record from the database, and the file is still left on the file server. I have tried the following <cffile action="delete" file="F:\downloads\#docpath#"> But I am getting the error ----------- Variable DOCPATH is undefined. 34 : 35 : <cffile action="delete" 36 : file="F:\downloads\#docpath#"> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326622 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4