Link to home
Start Free TrialLog in
Avatar of judsonmusic
judsonmusicFlag for United States of America

asked on

coldfusion multiple file upload

anyone know of a good way to allow someone to upload multiple files at once with coldfusion???

Like be able to select multiple photos on there computer and then click upload button and it will do al of them at the same time?


Judson
Avatar of erikTsomik
erikTsomik
Flag of United States of America image

Avatar of Zvonko
If you place five file upload controls on your form then will the form submit up to five files when user selected a file for each.
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MAGSGQ
MAGSGQ

Is it possible that you could expand on this and show how you could insert the information into a database?
Avatar of judsonmusic

ASKER

You would vreate a loop and do your insert statement inside of the loop. with that you you insert the five filenames into the database.

<cfloop from="1" to="5" index="i" >
  <cfif isdefined("form.uploadfile"&i) and form["uploadfile"&i] GT "" >
    <cfquery>
insert into mytable(image)
values('#cffile.ServerDirectory#\#cffile.ServerFileName#.#cffile.ServerFileExt#')
</cfquery>
  </cfif>
</cfloop>