I have a form that contains multi file upload like this one
<g:form name="legalActionForm" controller="legalAction" action="save" enctype="multipart/form-data">
<input type='file' name='documentFile'/> <input type='text' name='documentDate'/>
<input type='file' name='documentFile'/> <input type='text' name='documentDate'/>
<input type='file' name='documentFile'/> <input type='text' name='documentDate'/>
<input type='file' name='documentFile'/> <input type='text' name='documentDate'/>
<input type='file' name='documentFile'/> <input type='text' name='documentDate'/>
<input type='submit' value='update'/>
</g:form>
user can add more if needed ... how to get each file using iterators ?
if only one file I use request.getFile('documentFile');
but if I tried with request.getFileNames().each{obj -> println("${obj}"); }
I only got the first one ..
request.getMultiFileMap().documentFile.each {
println it.originalFilename
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With