Avatar of lulu50
lulu50Flag for United States of America

asked on 

Upload four images at the same time.

Hi,

I have this code that upload just one image to my folder.
how can I have four image upload at the same time.

Here's what I have.


<cfif IsDefined('FORM.upload_button')>
      <!--- upload to current directory by default --->
      <cfset targetDirectory = ExpandPath('.')&"\LoadImages\">

      <cffile nameconflict="overwrite" action="upload"
              destination="#targetDirectory#"
             filefield="FORM.upload_file" />
   
      <cfset pathToFile = targetDirectory &"/"& CFFILE.serverFile>

        <cfoutput>
                  image #CFFILE.serverFile# <img src="LoadImages/#CFFILE.serverFile#">
            </cfoutput>

</cfif>

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

<input type="file" name="upload_file"/>
<input type="submit" name="upload_button" value="Upload"/>

</form>

I know that I have to add three more input type file but what should I name them?
exp:
<input type="file" name="upload_file1"/>
<input type="file" name="upload_file2"/>
<input type="file" name="upload_file3"/>
now that I have three different upload name I have to change my code?

Thanks,
ColdFusion Language

Avatar of undefined
Last Comment
lulu50
ASKER CERTIFIED SOLUTION
Avatar of OP_Zaharin
OP_Zaharin
Flag of Malaysia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of lulu50
lulu50
Flag of United States of America image

ASKER

Op,

I tried this link
http://www.bennadel.com/blog/1117-Ask-Ben-Uploading-Multiple-Files-Using-ColdFusion.htm 
but I am getting an error that says Object require.  

Avatar of lulu50
lulu50
Flag of United States of America image

ASKER

Thank you
ColdFusion Language
ColdFusion Language

ColdFusion is a server-side rapid application development platform originally created by Allaire and now sold by Adobe, implementing the dynamic general purpose CFML programming language. The term ColdFusion is sometimes colloquially used to refer to the CFML language (Cold Fusion Markup Language), but can also include discussions of the server software implementation. ColdFusion runs using a customised version of Apache Tomcat. Earlier versions are bundled with JRun.

11K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo