The Problem:
We have a PHP-based website and on several pages we include a Java Web Start demonstration application and a hyperlink that points to the application.jnlp file. The hyperlinks work in both the Firefox and Chrome browsers, however when clicked in Internet Explorer (IE) XML is returned — the reason for this is that the content type needs to be set in order for IE to recognize that this is a Java Web Start application.
A further limitation is that the website is hosted on a virtual machine which we do not have access to, so it’s not possible to configure the server to set the content type for JNLP files.
The Solution:
We create the send-application-jnlp-file.php script below and edit the links so that they point to this file.
<?php
header('Content-type: application/x-java-jnlp-file');
header('Content-Disposition: attachment; filename="application.jnlp"');
readfile('application.jnlp');
?>