EasyCFM.COM ColdFusion Forums / General Discussion / Picture upload then resize

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Picture upload then resize

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

Cheesecake87
10-07-2011 @ 5:36 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 28
Joined: May 2010

<cfloop condition="img2done EQ 1">
        <cfif img1done EQ 0>
        
            <cffile action="UPLOAD" filefield="bpicture" destination="#ExpandPath('temp/')#" nameconflict="MAKEUNIQUE">
            
            <cfset bfile = File.ServerFile >
            
            <cfset bpicturer = ImageNew(#ExpandPath('temp/')# & bfile)>
            <cfset ImageResize(bpicturer, 150,"","lanczos")>
        
            <cfimage source="#bpicturer#" action="write" destination="#ExpandPath('temp/#pnameb#')#.jpg" overwrite="yes">
            
            <cfset img1done EQ 1>
        
        <cfelse>
        
                  <cffile action="UPLOAD" filefield="bpicture" destination="#ExpandPath('temp/')#" nameconflict="MAKEUNIQUE">
            
            <cfset afile = File.ServerFile >
               
               <cfset apicturer = ImageNew(#ExpandPath('temp/')# & afile)>
            <cfset ImageResize(apicturer, 150,"","lanczos")>
    
            <cfimage source="#apicturer#" action="write" destination="#ExpandPath('temp/#pnamea#')#.jpg" overwrite="yes">
            
            <cfset img2done EQ 1>
        
        </cfif>
</cfloop>

Is this the correct process ? - it dont seem to work.
Its a multiple file upload, trying to go through each file at a time. Let me know.

This message was edited by Cheesecake87 on 10-7-11 @ 5:36 AM


Website Designed and Developed by Pablo Varando.