hi guys,

just having a few problems with a script i have used on older cf servers (6 and 
7). i have attempted upgrading it to using the new cfimage tag. it seems to 
break down near the end when trying to delete the existing uploaded file. the 
file seems to be locked and access is denied.

my webhost have too restart the cfapplication in order to unlock the files.

has anyone had this trouble OR know of a better way i should now be handling 
this??

mike

<cffile action="UPLOAD" filefield="image_#Request.idx#" 
destination="#application.settings.fileDir#project_images\" 
nameconflict="makeunique" accept="image/jpg, image/jpeg, image/pjpeg, 
image/gif, image/png">
                        
                        <cfif cffile.fileWasSaved IS "Yes">     
                                <!--- get image info --->
                                <cfimage action="info" 
source="#application.settings.fileDir#project_images\#cffile.serverFile#" 
structname="imageInfo" />
                                
                                <!--- determine what resizing options are 
needed --->
                                <cfif (imageInfo.width GT 413)>
                                        <cfset resize_large = 1>
                                </cfif>
                                
                                <cfif (imageInfo.width GT 115) OR 
(imageInfo.height GT 87)>
                                        <cfset resize_thumb = 1>
                                </cfif>
                                
                                <!--- rename image --->
                                <cfset new_image_name = left(createUUID(), 13) 
& '.' & cffile.serverFileExt>
                                
                                <!--- apply image adjustments --->
                                <cfif resize_large>
                                        <cfimage 
source="#application.settings.fileDir#project_images\#cffile.serverFile#" 
action="resize" width="413" height="" 
destination="#application.settings.fileDir#project_images\#new_image_name#" 
quality="0.8">
                                </cfif>
                                
                                <cfif resize_thumb>
                                        <cfimage 
source="#application.settings.fileDir#project_images\#cffile.serverFile#" 
action="resize" width="115" height="" 
destination="#application.settings.fileDir#project_images\thumb_#new_image_name#"
 quality="0.8">
                                <cfelse>
                                        <cffile action="copy" 
source="#application.settings.fileDir#project_images\#cffile.serverFile#" 
destination="#application.settings.fileDir#project_images\thumb_#new_image_name#">
                                </cfif>
                                
                                <!--- delete original or rename --->
                                <cfif resize_large>
                                        <cfif 
fileExists("#application.settings.fileDir#project_images\#cffile.serverFile#")>
                                                <CFFILE action="Delete" 
File="#application.settings.fileDir#project_images\#cffile.serverFile#">
                                        </cfif>
                                <cfelse>
                                        <cffile action="rename" 
source="#application.settings.fileDir#project_images\#cffile.serverFile#" 
destination="#application.settings.fileDir#project_images\#new_image_name#">
                                </cfif>
                                
                        </cfif> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:310659
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