Grails file upload - how to recognize file and/or content type?

后端 未结 3 1778
执笔经年
执笔经年 2021-02-08 16:05

I\'m a Grails beginner, so please be patient with me. Currently I\'m having hard times manipulating file uploads. As far as I understand using request.getFile() I c

3条回答
  •  无人及你
    2021-02-08 16:47

    Or you can get uploaded file properties directly without using CommonsMultipartFile.

    def ufile = request.getFile("fileInputName")
    println(ufile.contentType)
    println(ufile.originalFilename)
    println(ufile.size)

提交回复
热议问题