I want to send an image from a java server (Restful Jax-rs). My client is Android.
@GET
public Response getUserImage() {
byte[] image =new byte[1024];
return Response.ok(image, MediaType.APPLICATION_OCTET_STREAM).header("content-attachment; filename=image_from_server.png") .build();
But here comes one download. So I want to download without loading, when I run the request URL in the browser, it should open automatically. Thank.
Surya source
share