I have a UDF that removes any chars besides letters, numbers, underscore and any additional good chars you specify to keep.
USAGE AlmostAlphaNumeric(FileName); // returns all letters, numbers and underscore AlmostAlphaNumeric(FileName,'@()'); // returns the same plus these chars:@() Is that something u are looking for? Baz -----Original Message----- From: Ray Champagne [mailto:[EMAIL PROTECTED] Sent: January 5, 2006 11:34 AM To: CF-Talk Subject: Re: 'safe' filename UDF Actually, that *is* what I do, too. But, this app was written long ago, by someone else, and has been running this way for a while. Somehow, an issue never came up until someone uploaded an image file named Lot #31.jpg, which caused an error when displaying a popup image window. Changing the way the whole thing works at this point just isn't going to fly. Wish I knew how to write RegExp's, prolly wouldn't be that hard to do, if I don't hear anything here today, I'll prolly just figure out how to do it myself. It's about time I learned how to use RegExp's anyways. Thanks Ray Bobby Hartsfield wrote: > I don't, but what I usually do is save the original file name as is just for > display purposes so the person who uploaded it can spot it easily. Then > rename the file according to some other things... like and ID in the > database, a category, etc... > > So a link to a file might look like... > > <a href="0001.pdf">Old File Name.pdf</a> > > Just an idea... > > ..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. > Bobby Hartsfield > http://acoderslife.com > > > > -----Original Message----- > From: Ray Champagne [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 05, 2006 11:02 AM > To: CF-Talk > Subject: 'safe' filename UDF > > Anyone have a good UDF to replace "bad" characters in a filename with > "safe" ones? ie, replace # signs with blanks, spaces with '_', commas, > periods, etc? I just looked on cflib and found nothing. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228585 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=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54