Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_java thread: Re: Java-Applet post to CGI


Message #1 by "Robert Accardi" <raccardi@u...> on Thu, 18 Oct 2001 16:01:18
I am trying to do the EXACT SAME thing.
What you will definitely need is something on the server side, either a 
CGI script to handle uploads, or a daemon with a
             listening socket. I am using a CGI script.
I still haven't figured out how to make the applet send over the image, 
however. here's what I've loosely put together so
             far:
Make a URL Object pointing to the CGI script on the server.
Run the URL's openConnection method and cast the returned URLConnection to 
a HttpURLConnection.
Set some properties on the HttpURLConnection like .doOutput(true) and you 
may need to set the content length and content
             type.
Get the HttpURLConnection's outputstream with .getOutputStream.
From there, you probably have to wrap the outputstream and somehow encode 
the Image, but I still haven't figured it out.
Good luck, and post whatever you find!

  Return to Index