First of all, to do any file I/O, the applet needs to be signed, or the local security policy altered. Both are described in HowCanAnAppletReadFilesOnTheLocalFileSystem.
Reading and writing images is done using the javax.imageio.ImageIO class and its read and write methods. An example is here.
[ May 29, 2007: Message edited by: Ulf Dittmer ]
You could either use HTTP to POST the image data to a servlet on the server, or use FTP to transfer the file (if the server has FTP access). Involving a servlet has the advantage that it's easy to perform any post-processing after the upload has finished.
Here's an example of an applet posting to a server. In this case, serialized objects are being transferred, but you can send the image data instead.
I gone through that EchoApplet example. it working properly and i use that code in my application. But when i run my application i got an exception.
I am posting the stack trace below.
java.net.UnknownServiceException: protocol doesn't support output
My code :
First of all I am sorry that I forgot to mention in my previous post that we are no longer using Windows IIS - that issue is resolved with the client and now we are back on Tomcat5.0
I am posting the Exception here.
Now from the above I came to conclusion that the exception is coming because the BufferedImage class doesn't implement the Serializable interface.
So i am not able to figure how to resolve this situation.
Can you help me with this please.