What about renaming all the filenames with spaces
to remove the spaces, then move them.

Use cfdirectory to get a list of the filenames, then
loop over the results and rename the files without spaces:

<cfset newFileName = replace(originalFileName, " ", "", "all") />

Then use cfdirectory to get the new file list, loop over
that list and use cffile action="move"...>.

Or it might work just as well to rename and delete in the
first loop over the directory filelist.

Rick

-----Original Message-----
From: Adrian Cesana [mailto:[email protected]] 
Sent: Wednesday, January 16, 2013 1:18 AM
To: cf-talk
Subject: CFFILE and spaces in file name (Not Upload)


I am cleaning up an older site that has grown a bit out of control with all 
images being dumped into a single
directory.  Almost all the filenames have a space in them.

I am trying to use CFFILE action="move" to clean things up but apparently 
CFFILE does not like the spaces in
the file names.  Any clever ways around this?

As I type this I am thinking I could use CF to write a CMD script and then just 
run it in good old DOS prompt
since its a one time thing.  I would rather not do this as I plan to update a 
DB field as the script process's
so I know where I am when it times out..
 

Man....CF has come so far since the Bob Denny days, but then the simplest 
things choke it.....

 

~Adrian



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353923
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to