• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending data from Applet to CGI

 
Mark Sievers
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, here's my problem:
I wrote an Applet in which you can manipulate Images. Now I want the Applet to send back the BufferedImage back to the Server. I do not want to use servlets due to usage of tomcat, so I want to post the data to a PHP-Script. Is this possible? I opened a new URLconnction to the Server, but it didn't work to post data. Any help would be appreciated...
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be able to post data from an Applet to a PHP server as long as you make a valid HTTP session out of it. Your only limitation is that the PHP server be the same machine that the applet was loaded from (standard Java sandbox limitation).
 
Mark Sievers
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HOW???
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You open a URLConnection inside the applet, send the data, then retrieve the response. I no longer have that source code, but it wasn't very difficult - I used the O'Reilly "Java Examples in a Nutshell" network programming chapter as a guide. They have the sample network source code on their website (http://www.ora.com)
Also, look through the recent messages here - some good starter code is in one of them.
[This message has been edited by Tim Holloway (edited August 16, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic