Advertisement

12.21.2007 at 02:33AM PST, ID: 23037844 | Points: 500
[x]
Attachment Details

CFFTP recursive deletion

Asked by chrissp26 in Cold Fusion Markup Language

Tags:

Hello,

I'm trying to remove all files and directories within an FTP site and need a little help.

Is there anyway I can recurse through a directory and delete all sub files and directories? Or do I need to do all files and directories seperatly?

THe reason I need to delete is because I need to replace a large number of the files on te FTP server, so I thought it best to remove everything that was there and then replace them with a more recent copy of the site. Is that the best way?

If there is no recursive function for CFFTP how would I write a loop that could pass through each directory level deleting all files and directories within?

Thanks for your help and sorry for all the questions.

Kindest regards

ChrisStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
<cfloop query="listFTPfiles">
	<cfif isDirectory>
		<cfftp 
		action="removeDir"
		connection="demosite"
		directory="#FTPRoot#/#name#"
		>
	<cfelse>
		<cfftp
		action="remove"
		connection="demosite"
		item="#FTPRoot#/#name#">
	</cfif>
	
</cfloop>
 
 
[+][-]12.21.2007 at 08:22AM PST, ID: 20514571

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.21.2007 at 08:31AM PST, ID: 20514635

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.21.2007 at 09:17AM PST, ID: 20514968

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.14.2008 at 08:40PM PST, ID: 22965816

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628