Skip to main content
Participating Frequently
March 25, 2009
Question

cfdirectory

  • March 25, 2009
  • 2 replies
  • 734 views
Hopefully this will be easy...running on Windows Server 2003, Apache, CF8.

I tell it to delete a folder inside my "boxes" directory, it also deletes the "boxes" directory also and everything in it.

<cfdirectory directory="e:\Apache2.2\htdocs\sites\smart\dropbox\boxes\#deletedrop.drop_folder_name#" action="delete" recurse="yes">

#deletedrop.drop_folder_name# is coming out as 21643-1(A)-jhkhj, so I know that its getting the correct variable.

Example: I have a folder inside the directory "boxes" directory called "21643-1(A)-jhkhj" that I want to delete and everything inside it. The above code is deleting all directories inside the boxes directory including itself.

Thanks for any help.

Matthew
This topic has been closed for replies.

2 replies

tclaremont
Inspiring
March 25, 2009
Some ideas...

Try putting a slash after #deletedrop.drop_folder_name#"

Also, if that variable is not correct, it will truncate and likely delete the boxes directory.

Do a CFDUMP on that page and make sure the variable is correct.

Use the TRIM function around the variable to make sure there are no leading or trailing spaces.

One of those should lead you to the problem.
Inspiring
March 25, 2009
Hi Matthew,

You mean that, it is actually deleting the "boxes" directory too?
-Matthew-Author
Participating Frequently
March 25, 2009
I don't mean to sound rude, but the first line of my post explains that, yes, it deletes the boxes directory also. I just want it to delete one directory inside the "Boxes" directory and all the contents inside that targeted folder.

Matthew