Grails File Upload Problems

后端 未结 4 2110
花落未央
花落未央 2021-02-06 06:40

I\'m trying to emulate the file upload code from the grails website, and I\'m running into some problems. I\'m using the same code as found here. Here is my code:



        
4条回答
  •  爱一瞬间的悲伤
    2021-02-06 06:52

    Now with the Grails 2.x use:

    
         
    
    
    def upload = {
        def file = request.getFile('file')
        assert file instanceof CommonsMultipartFile
    
        if(!file.empty){ //do something }
        else { //do something }
    }
    

    More clean, more simple.

提交回复
热议问题