i do this a lot anymore because people do tend to name files weirdly and when
they start putting stuff like like Mike's big fish march-2007.jpg in it itend
to mess things up.
here is something I just put in, it uses Badass Bobbies random string udf
<cfscript>
fileType = right("#file.serverfile#", 3)
randImageName = randStr("4,8", "alphanumericupper");
newImageName = "upload-" & randImageName & "." & fileType;
</cfscript>
>Is there a good/safe way to use cffile to upload a file out to the
>server and rename it at the same time? Only problem is, the file type is
>usually unknown - could be a Word doc, rtf, pdf, xls ....
>
>Folks are wanting to use some really weird file names at times and I'd
>like to rename everything to simply match a previously existing ID.
>
>Here's a real file name someone tried to use:
>
>2006 CBF TRIP (for Travel ins) and Marco revised as of Apr 19 _June
>30th-revised.xls
>
>Yea, right....
>
>Id rather force that to the record ID and date like
>Rec1234-20061224.xls
>
>
>Ideas?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:294567
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4