Uploading file throws No signature of method exception (in getFile() method)

后端 未结 1 1269
小鲜肉
小鲜肉 2021-01-23 03:58

Im trying to upload a file, and store it in a file. This is the code in the GSP:



        
1条回答
  •  孤城傲影
    2021-01-23 04:08

    The problem is that your request is not treated as a MultiPartRequest. Do something like this:

    MultipartRequest multipartRequest =  request as MultipartRequest
      if(multipartRequest){
        MultipartFile attachmentFile = multipartRequest.getFile("attachment_file".toString())
        if (attachmentFile) {
            -- copy it ---
        }
      }
    

    0 讨论(0)
提交回复
热议问题