Announcement Announcement Module
Collapse
No announcement yet.
Upload large file issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Upload large file issue

    Hello All,

    I am getting issue on posting large file to spring via jersy client..
    code I have written for sending file :

    client side code: -

    Client client = Client.create();
    WebResource webResource = client.resource(url);
    MultiPart multiPart = new MultiPart();
    FileDataBodyPart filePart = new FileDataBodyPart("file", file,
    MediaType.APPLICATION_OCTET_STREAM_TYPE);
    multiPart.bodyPart("code",code);
    client.setChunkedEncodingSize(10000);
    webResource.type(MediaType.MULTIPART_FORM_DATA).po st(String.class,
    multiPart);

    and on the server side i have written something like this:

    @RequestMapping(value = "/upload", method = RequestMethod.POST)
    public void upload(@RequestParam("file") MultipartFile uploadedFile,
    @RequestParam("code") String code,
    Writer responseWriter) throws IOException
    {
    }


    when i run client code i am able to get file from uploadedfile param But the value of parameter 'code' ia always be blank .. can anyone tell me how can i retrieve value of other parameters while sending multipart data..

    Thanks
Working...
X