<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>
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE