Copy link to clipboard
Copied
I know of cffileupload, but it looks like it can not work with other form elements in same form, since its flash based.
Is there any other way to incorporate a multi file uploader tag in a form. cffile only allows for one file upload.
Thanks
Copy link to clipboard
Copied
You could just extend the basic upload for one file to two or more files. Here is an example:
<cfif isDefined("Form.FileContents") >
<cffile action = "upload"
fileField = "FileContents"
destination = "c:\uploads"
accept="image/jpeg,image/jpg,image/pjpeg,image/png"
nameConflict = "overwrite">
<cffile action = "upload"
fileField = "FileContents2"
destination = "c:\uploads"
accept="application/pdf"
nameConflict = "overwrite">
Done uploading files.
<cfelse>
<cfoutput><form method="post" action="#cgi.script_name#" enctype="multipart/form-data"></cfoutput>
<input name="FileContents" type="file">
<br>
<input name="FileContents2" type="file">
<br>
<input name="submit" type="submit" value="Upload File">
</form>
</cfif>