user943194
user943194

Reputation:

Is it possible to read/write a file from an applet

I've trying to read and write a file from an applet so if I run the applet from my appletviewer it is possible for me to read/write a file but when I try to do it from my browser I get a security exception. Any idea how to do this?

Upvotes: 4

Views: 1513

Answers (3)

Andrew Thompson
Andrew Thompson

Reputation: 168825

A sand-boxed JWS app. can read and write to files on the local file system using the JNLP API services. Here is a demo. of the JNLP API file services. The downloadable Zip file contains the source, launch file and build script.

Upvotes: 1

Kash22
Kash22

Reputation: 111

it's actually not that difficult. You can self sign an applet and then it will be able to read/write to/from the local file system outside the sandbox constraints. take look at the link below. it will show you how to sign your applet using the keytool and the example actually does read/write to the filesystem. no need to muck about the policy files and such.

Note that as @aioobe mentioned, the user will be prompted to accept the certificate though.

Upvotes: 0

aioobe
aioobe

Reputation: 420951

Is it possible to read/write a file from an applet

Yes, but you need to sign the applet and get approval from the user.

Some useful links:

Upvotes: 5

Related Questions