Open image CONTENTS

There are two methods to open an image file located on the client's computer:

Upload the image to the server

Open the image directly

If the user has Java Plugin 2 (available in Java 1.6 Update 10 or later) the applet can open files from the user's computer directly (if the user will allow it).

The "open" button is not displayed by default. You have to specify it explixitly in the list of actions with the applet parameter "actions", for example:

<param name="actions" value="clear,open,save,undo,redo">

Or you can invoke the "Open" action in JavaScript via the applet function doAction('open').

You can check if the Java Plugin 2 is available on the client's computer in JavaScript. For that call the applet's function getParameter('plugin2'). If it returns 'true' (String value) the the plugin is available. Note: the applet parameter "jnlp_href" must be specified to obtain the correct value.


FYI: The file plugin2.jnlp contains the applet description for the Java Plugin2 and is located in the applet's directory. When the user opens a file on his/her computer Java asks the user's permission. The Warning dialog displayes the Applet Vendor name which is defined in plugin2.jnlp. If you don't like the Autor's (i.e. my) name to be displayed open plugin2.jnlp in any text editor (since it is an XML file) and modify the Vendor name according to you preferencies. I do not consider this modification as my Copyright violation.