Applets and reading files...

T

ted holden

Does anybody have any idea what it might take to allow an applet to read a
local file? This is for a simple demo which would not involve anything
other than a laptop computer which was not connected to anything other than
electricity.

I've used policytool.exe to set a read permission on the file in question
and I've included the file's directory in the java classpath and nothing
seems to help, I still get the same access permission error.
 
B

Bob

ted said:
Does anybody have any idea what it might take to allow an applet to read a
local file? This is for a simple demo which would not involve anything
other than a laptop computer which was not connected to anything other than
electricity.

I've used policytool.exe to set a read permission on the file in question
and I've included the file's directory in the java classpath and nothing
seems to help, I still get the same access permission error.

Are you able to read the file okay if you use an application rather than
an applet?

All I remember about applets is that they are severely restricted, to
stop the sort of exploits that ActiveX was famous for.
 
L

Lee Ryman

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ted said:
Does anybody have any idea what it might take to allow an applet to read a
local file? This is for a simple demo which would not involve anything
other than a laptop computer which was not connected to anything other than
electricity.

I've used policytool.exe to set a read permission on the file in question
and I've included the file's directory in the java classpath and nothing
seems to help, I still get the same access permission error.

Unfortunately you have to do a bit more than that :p

The applet and its .policy file need to be in a .jar file which is
signed with a certificate from yourself/your company. Googling "signing
applets" gives some appropriate references. In particular this Google
result...

http://java.sun.com/developer/technicalArticles/Security/Signed/

... isn't a bad place to start. Remember grasshopper, STFW.

Regards,

Lee
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iEYEARECAAYFAkKEf7EACgkQhbcFpQga0LDCiwCeMud7xQqrBRUu80ULbtOWAjjn
+Z4AnRY1ma/HG+X7Hzdj8kapA7iis+Mg
=+lxK
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top