mercredi 22 avril 2015

Safari Extension available via a web server

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:-

<%String filename = "<safariextz file path>" ;        
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();%>

But the resulting file can not installed on the safari browser and throwing error:- Safari can't install this extension

An error occured while installing this extension.

I also want that installation start the moment user click on Install link like in apple gallery.

Thanks




Aucun commentaire:

Enregistrer un commentaire