views:

32

answers:

1

I'm doing a groovy/grails form file-upload operation, as is described here

http://www.grails.org/File+Upload

I'd like to get the name of the file that the user is uploading. Is there any way to do that? I've dumped out the params and request dictionaries and don't see them in there.

+3  A: 

You can get it via the getOriginalFilename() of MultipartFile e.g.

MultipartFile fileStream = request.getFile("myFileInputName");
def originalName = f.getOriginalFilename()
leebutts