Grails

Groovy HTTP builder for sending multipart file.

I had two applications that communicate with each other through web-services. There I had a requirement to send multi-part file from one application to another. After searching I came out with the following solution and thought to share: [java] import org.apache.http.entity.mime.MultipartEntity import org.apache.http.entity.mime.HttpMultipartMode import org.apache.http.entity.mime.content.InputStreamBody import org.apache.http.entity.mime.content.StringBody import groovyx.net.http.* void sendMultiPartFile(CommonsMultipartFile multipartImageFile, String cityName) { […]

Divya Setia
Divya Setia
Read

Grails

uploading multiple files with same name

Grails does not support accessing multiple file input fields with same name using params.fieldName. We need to use request.multiFileMap (available in Spring 3.0) instead of request.fileMap. The blog provides sample code to achieve this feature via Grails Filter.

Bhagwat Kumar
Bhagwat Kumar
Read