It's so difficult accounting for every single "Stupid User Trick" that 
you often just want to run screaming off into the sunset at times. 
Regardless of what safeguards (client *and* server side validation, 
cfquery param, blah...blah....) you put in place, somebody comes up with 
*something* that mucks up the works and refuses to "do it right" and 
your client says "YEs, that's stupid, but figure out how to deal with 
that!".

Now that I've got that off my chest...

I'm dealing with a CFFILE field. It accepts text, .doc, and .xls files. 
I do *not* want to accept the original file names, because folks are 
pretty much idiots and will name a file anything.

Here's one somebody tried to enter as a test today:

"Insurance Enroll. Info for Germany Partnership for Jason & Tommy..xls"

Yup, that whole line of text is an actual file name.

OK, I want to rename this with the record ID that goes into the 
database, so "397564.xls" looks great to me instead of the above.
Got no problem with the record ID part - how do I extract the correct 
file extension to tag onto the renamed file, since it can vary, and 
since it can look like something really stupid like the above .xls file?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279035
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to