Devi ottenere InputStream da MultipartFile hai superato come mostrato nella documentazione:
<g:uploadForm action="upload">
<input type="file" name="filecsv" />
<input type="submit" />
</g:uploadForm>
Allora;
def upload = {
request.getFile( 'filecsv' )
.inputStream
.splitEachLine(',') { fields ->
def city = new City( city: fields[0].trim(),
description: fields[1].trim() )
if (city.hasErrors() || city.save(flush: true) == null) {
log.error("Could not import domainObject ${city.errors}")
}
log.debug("Importing domainObject ${city.toString()}")
}
}