That worked! Thanks.
Now I am having another issue. I need to get a file that is being sent
from server side as an attachment.I am using Jersey client on client
side.
Here is the server side code -
String fileToDownload = "Result.zip";
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;
filename=\""
+ fileToDownload + "\"");
ServletOutputStream sos = null;
try {
sos = response.getOutputStream();
} catch (IOException ioex) {
System.out.println("streamForDownload:::::::" +
ioex);
}
How can I get the file from ClientResponse object on client side?
Thanks
-Jitesh
-----Original Message-----
From: Pavel Bucek [mailto:pavel.bucek_at_oracle.com]
Sent: Thursday, June 23, 2011 12:13 AM
To: users_at_jersey.java.net
Subject: [Jersey] Re: How to post a file and other form fields by Jersey
client
yes, that will work.
On 6/23/11 3:29 AM, Jitesh wrote:
> Do I put it into response entity on server side like this -
>
> Response.ok(String.valueOf(Id)).build() ;
>
> where Response is javax.ws.rs.core.Response .
>
> and then I get it as you have mentioned in your post?
>
> Thanks
> -Jitesh
>
> --
> View this message in context:
http://jersey.576304.n2.nabble.com/How-to-post-a-file-and-other-form-fie
lds-by-Jersey-client-tp6502947p6506822.html
> Sent from the Jersey mailing list archive at Nabble.com.
>