title: Safari Extension available via a web server
body: <p>I am working on safari extension and want to publish the extension on my website. I am using following code so that user is able to download the .safarixtz file and then install it:-</p>
  
  <pre><code>&lt;%String filename = "&lt;safariextz file path&gt;" ;        
  response.setContentType("application/octet-stream safariextz");
  
  String disHeader = "Attachment;filename=test-safari.safariextz";
  response.setHeader("Content-Disposition", disHeader);
  
  // transfer the file byte-by-byte to the response object
  File fileToDownload = new File(filename);
  response.setContentLength((int) fileToDownload.length());
  FileInputStream fileInputStream = new FileInputStream(fileToDownload);
  int i = 0;
  while ((i = fileInputStream.read()) != -1) {
      out.write(i);
  }
  fileInputStream.close();%&gt;
  </code></pre>
  
  <p>But the resulting file can not installed on the safari browser and throwing error:-</p>
  
  <p>Safari can't install this extension
  An error occurred while installing this extension</p>
  
  <p>I also want that installation start the moment user click on Install link like in apple gallery.</p>
  
  <p>Thanks</p>