Upload Images java applet

Hello,

We are trying to create a java applet that will be hosted in an ASP .NET-based web application, to help a user select an image file from the client computer (such as jpg, gif or another supported image type). After that we want to do jpeg-encode the image on the client side (within the applet) and upload the result to the server.

After using FileDialog's show() method to display the Open dialog and allow the user select the image file, we try to get the image with getImage("file://" + selectedDirectory + selectedFile).

The problem is that the applet cannot (by default) read the image: getImage throws a AccessControlException with denying SocketPermission.

We tried to sign the applet by using jarsigner with a certificate generated with keygen (so with an unofficial certificat), for tests purposes only. However, even when the applet's jar is signed, the same exception is thrown and the dialog asking the user whether or not he or she would allow this applet to run (since it was signed with an unoficial certificate) does NOT appear, as we expected.

One more thing (may not be related): When removing the Name=... attribute from the APPLET tag (and only keeping class="the.class" and archive="the.jar") the applet won't load unless the HTML page is open directly from Windows Explorer (it won't load when load as http://localhost/testpage.htm).

Thanks for any suggestions you may have.

[1450 byte] By [ioanapvcluj@yahoo.coma] at [2007-10-1 22:24:51]
# 1

> However, even when the applet's jar is signed, the same exception is thrown ...

you must have done something wrong, try doprivileged if your code is called by untrusted code

like javascript.

You might try non depreciated html and have a go at the htmlconverter in the jdk bin directory to

convert your html pages.

Signing applets:

http://forum.java.sun.com/thread.jsp?forum=63&thread=524815

second post and last post for the java class file using doprivileged

Uploading using multipart/form-data:

http://forum.java.sun.com/thread.jspa?threadID=530445&tstart=270

Still problems?

A Full trace might help us out:

http://forum.java.sun.com/thread.jspa?threadID=656028

harmmeijera at 2007-7-13 8:39:01 > top of Java-index,Security,Signed Applets...