Grails – how to upload multiple files?

I was getting trouble upload multiple files and then I found this article:
http://www.tothenew.com/blog/uploading-multiple-files-with-same-name/
Basically, the author just uses mutipleFileMap and then you can handle the files:

def multipleFileMap = multiRequest.multiFileMap
/* instead of using fileMap. However this map value is always a list even if there is only one file input for a name */
multipleFileMap.each {fieldName, files ->
params.put(fieldName, files)
}

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a comment