Thanks everyone, for the help...
Here's the final solution, if anyone's interested:
<cffile action="upload" filefield="photo_01_upload" destination="#uppo#"
accept="image/jpg, image/pjpg, image/jpeg, image/pjpeg, image/png"
nameconflict="makeunique">
<cfset form.photo_01="#file.serverfile#">
<cfimage action="resize" height="" width="400" source="#rppo##file.serverfile#"
destination="#wppp#/#listfirst(file.serverfile, '.')#_w400.jpg"
overwrite="yes">
<cfimage action="resize" height="" width="100" source="#rppo##file.serverfile#"
destination="#wppt#/#listfirst(file.serverfile, '.')#_w100.jpg"
overwrite="yes">
This gives me the original image in a folder, "Original", with the original
filename intact:
"House.jpg".
A resized 400px wide image in a folder, "popup_400", with the original filename
changed to:
"House_w400.jpg".
And a 100px wide image in a folder, "thumbnails_100", with the original
filename changed to:
"House_w100.jpg".
I realize I don't have to rename the photos because they're going into separate
folders. However,
in case I
ever want to know the width or id the photo by name, I can just look at the
filename spec.
If anyone sees any improvement that can be made in the code, please let me know!
One thing I did notice is that the cfimage tag doesn't have a "nameconflict"
option.
It seems it really needs one. Any reason why it wouldn't have one?
Rick
> -----Original Message-----
> From: Web Specialist [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 07, 2007 12:13 PM
> To: CF-Talk
> Subject: Re: How do I get the characters after the last period in a string?
>
> <cfset ext = GetToken(file_name,2,'.')>
>
> Cheers
>
> 2007/11/7, Todd <[EMAIL PROTECTED]>:
> >
> > Plenty of things to do here.
> > 1.) Use regular expression.
> > 2.) Treat the string as a list using the "." as a delimiter (e.g.: <cfset
> > name = listFirst(varname,'.')> )
> >
> > On Nov 7, 2007 11:41 AM, Rick Faircloth <[EMAIL PROTECTED]> wrote:
> >
> > > This seems so simple, yet I couldn't figure out the answer even after
> > > going through the list and strings functions in the docs for CF 8.
> > >
> > > I want to return the characters in the name of a photo preceding the
> > > period.
> > >
> > > i.e.. If the photo is named "dog.jpg", I want to strip out ".jpg" from
> > the
> > > filename so I can alter the filename and then "reattach" the ".jpg".
> > >
> > > Seems so simple, but I can't figure out how to get it done.
> > >
> > > Rick
> >
> >
> >
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292851
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4