开发者

How do I send an Object and a file in a single HTTP request in java?

I need to send a java object and a file via HTTP in a single HTTP request. I am facing following issue:

I am using org.apache.commons.httpclient.HttpClient implementation for this and the problem is the servlet on the server side expects the multipart request as mentioned in the request and hence the Object whic开发者_如何学Goh I send as a byte[] stream gets corrupted. If I just either file or object in a single request then this works fine.


Have you tried this tutorial: http://evgenyg.wordpress.com/2010/05/01/uploading-files-multipart-post-apache/ ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜