title: How can I return a Zip file from my Java server-side using JAX-RS?
body: <p>I want to return a zipped file from my server-side java using JAX-RS to the client.</p>
  
  <p>I tried the following code,</p>
  
  <pre><code>@GET
  public Response get() throws Exception {
  
      final String filePath = "C:/MyFolder/My_File.zip";
  
      final File file = new File(filePath);
      final ZipOutputStream zop = new ZipOutputStream(new FileOutputStream(file);
  
      ResponseBuilder response = Response.ok(zop);
      response.header("Content-Type", "application/zip");
      response.header("Content-Disposition", "inline; filename=" + file.getName());
      return response.build();
  }
  </code></pre>
  
  <p>But i'm getting exception as below,</p>
  
  <pre><code>SEVERE: A message body writer for Java class java.util.zip.ZipOutputStream, and Java type class java.util.zip.ZipOutputStream, and MIME media type application/zip was not found
  SEVERE: The registered message body writers compatible with the MIME media type are:
  */* -&gt;
    com.sun.jersey.core.impl.provider.entity.FormProvider
  </code></pre>
  
  <p>What is wrong and how can I fix this?</p>