I ALWAYS remove spaces from file names (I actually remove anything other
than letters, numbers, underscores, hyphens and periods). Normally, I just
replace them with underscores or hyphens. It's just easier than worrying
about them. If anyone complains, store the original name in the database
along with the new renamed file name and use the original name for links and
such. : )
<cfset filename="my file.jpg">
<cfset newfilename = replace(filename, " ", "_", "ALL")>
<cffile action="rename"
source="/path/to/some/file/#filename#"
destination="/path/to/file/#newfilename#" />
..:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-----Original Message-----
From: Tim Laureska [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 11, 2005 10:41 AM
To: CF-Talk
Subject: getting rid of spaces in file names
Had not run been exposed to this problem before... using CFMail to send
jpg files to designated recipients (and CFILE to record the file
names)... if there's a space in the file name like "my photo.jpg", that
jpg is not sent via cmail
..... can someone give me a quick tip on how to deal with this issue...
not sure if eliminating that space or spaces in a filename is the way to
go (or how to do that)
Tim
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220721
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54