Upload four images at the same time.

lulu50
lulu50 used Ask the Experts™
on
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,
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2011
Commented:
- i'm away from my machine to work on your code. however here is two method that you can use for handling multiple file upload using cffile and cfloop:

http://www.devarticles.com/c/a/ColdFusion/Multiple-File-Upload-with-CFFILE/

http://www.bennadel.com/blog/1117-Ask-Ben-Uploading-Multiple-Files-Using-ColdFusion.htm

Author

Commented:
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.  

Author

Commented:
Thank you

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial