I have a form with several input fields that accept multiple files and I need to load the files from each element to a different destination. cffile upload only uploads the first file from each form field and uploadall puts them all in all the directories because it doesn't support the fieldname attribute.
<form name="someForm" id="someForm" action="process.cfm" enctype="multipart/form-data" method="post">
<input type="file" multiple="multiple" name="fileSet1" />
<input type="file" multiple="multiple" name="fileSet2" />
<input type="file" multiple="multiple" name="fileSet3" />
<input type="submit" value="update" />
</form>
This uploads one file to each destination:
<cffile action="upload" filefield="fileSet1" destination="dest1" nameconflict="overwrite">
<cffile action="upload" filefield="fileSet2" destination="dest2" nameconflict="overwrite">
<cffile action="upload" filefield="fileSet3" destination="dest3" nameconflict="overwrite">
This uploads all file to all destinations because filefield doesn't go with uploadall:
<cffile action="uploadall" filefield="fileSet1" destination="dest1" nameconflict="overwrite">
<cffile action="uploadall" filefield="fileSet2" destination="dest2" nameconflict="overwrite">
<cffile action="uploadall" filefield="fileSet3" destination="dest3" nameconflict="overwrite">