troubleshooting Question

Resize the images

Avatar of lulu50
lulu50Flag for United States of America asked on
ColdFusion Language
24 Comments2 Solutions406 ViewsLast Modified:
Hi,

I need to resize my images before upload them to my folder.
How would I do this?

here's what I have so far:


<cfset numberoffields = 4>
<cfset targetDirectory = ExpandPath('.')&"\LoadImg\">
  <cfif isdefined("form.upload")>
    <cfset message = "">
    <cfloop index="i" from="1" to="#variables.numberoffields#" step="1">
      <cfset filename = "form.file" & #i#>
      <cfif evaluate(variables.filename) neq "">
        <cffile action="UPLOAD" 
           destination="#targetDirectory#" 
           nameconflict="OVERWRITE" 
           filefield="#variables.filename#"/>
        <cfset message = message & ",File%20#i#%20(#file.serverfile#)%20was%20uploaded">
      <cfelse>
        <cfset message = message & ",File%20#i#%20was%20empty">
      </cfif>
    </cfloop>
    <cflocation url="PostAd.cfm?ChID=1&msg=#variables.message#">
   
 <cfelse>
     <cfif isdefined("url.msg")>
       <div style="color:#FF0000;">
       <cfloop list="#url.msg#" index="i">
         <cfoutput>#i#</cfoutput><br />
       </cfloop>
       </div>
    </cfif>

<form name="RTEDemo" action=""#CGI.script_name#"?ChID=1" method="post" onSubmit="return submitForm();" enctype="multipart/form-data">



     <cfloop index="i" from="1" to="#variables.numberoffields#" step="1">
      <cfset filename = "file" & #i#>
      <input type="File" name="<cfoutput>#variables.filename#</cfoutput>" /><br />
      </cfloop>
  <input type="Submit" name="upload" value="upload">

</form>
</cfif>

Open in new window

ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 24 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 24 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros