Copy link to clipboard
Copied
I had some code that was developed for a windows server to create some image files. The destination parameter had backslashes in the path. When run on a Coldfusion 9 linux server, the files ended up in the top directory with long filenames consisting of ' directory\directory\filename'. Now I need to delete them. I've tried cffile action="delete" file="directory\\directory\\filename">.
Copy link to clipboard
Copied
Execute cfdirectory on the directory in question. Loop through the query object and use whatever field refers to the name of the file. I'd have to look that up, but you can do that.
Copy link to clipboard
Copied
Did just deleting them exactly as-is (ie: without escaping the backslashes) not work?
--
Adam
Copy link to clipboard
Copied
The syntax is <cffile action="delete" file="absolute_path_to_the_file">. So what you need to do is figure out how to get the absolute path, on the basis of the current page.
Copy link to clipboard
Copied
ExpandPath() should work.
V/r,
^_^
Copy link to clipboard
Copied
The Longpathtool is the very best program for error, unlock solution. Try it and solved your problem. I used the long path tool and I solved my error, unlocks problem solution.