You can use the image functions in cf8 to resize, assuming you have cf8.
Something like this (off the top of my head - no error handling in this):

<cffile action="upload" destination="#application.image_root#"
nameConflict="makeunique" filefield="imageFile" result="fileupload">

<cfset newfile = fileupload.serverdirectory & "\" & fileupload.serverfile>
<cfset imageFile = fileupload.serverfile>

<cfset myImage = imageRead(newfile)>
                   
<cfset largeSize = 300>

<!--- create a reasonable sized image (max 300px wide) --->
                      
<cfif myImage.width GT largeSize>  
                                                
<cfimage action="resize" height="" width="#largeSize#" source="#newfile#"
destination="#application.image_root#/#imageFile#" overwrite="true"/>   

</cfif>



-----Original Message-----
From: Keith McGee [mailto:kpmc...@frontiernet.net] 
Sent: 29 September 2009 11:56
To: cf-talk
Subject: Resizing images on upload


Is there a way to resize a users image when they upload it? I want to have
the image formated smaller so it doesn't take up unessasary space on the
server and use up unessasary bandwith viewing the image.

Coldfusion program would be nice but will try anything.

Keith





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326735
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