Re: Java applet file handling on Web
I want to create/read/write files using a Java applet
If using a rich client, why not launch the GUI using web start?
If using web start, it might be better to just make it an
application (based on a JFrame).
..on a website.
Reading the (publicly accessible) files from the same
web site is no problem.
Creating and writing files on a web site is a whole
different matter. Mostly there are security considerations,
and the *web site* itself must support the file upload
functionality. The upload code on the server might
be written as JSP, Servlet, (PHP, ASP..), but the client
itself cannot take responsibility for writing the files,
the server *must* do that itself.
That is why..
I've written a trivial applet in Netbeans & it runs OK when tested in
NetBeans. When moved to a different folder on my PC with a .html file
to call it, it gives error "Java.security.AccessControlException:
A 'client' such as an applet (or JWS appl.) cannot get
a 'File' on the 'server' - ever.
To access files on the client is a different matter
again. An applet would need to be signed and accepted
by the user with full permissions - even then, there was
suggestion some of the latest IE browser variants
will limit the directories that an applet can read
A JWS app. would *not* need to be signed to access
files off the local file-system. Instead it could use the
extra services available in the JWS (javax.jnlp.*) API,
such as the FileOpenService.
What sort/flavor(/size..) of files are you needing to support?
What does this 'file upload' facility aim to provide to
the end user? (the wider picture, like 'allow them to
create web based sites generated from genealogy
files' or 'enable the user to create image slideshow
Message posted via JavaKB.com