OK so I have the following method, and it gives no errors. I will have
to set up the PHP script on the server and will get back to you guys
later on. Thanks for your help so far!
One quick question: why is it not giving an error when I use a
BufferedImage instead of a RenderedImage? Is it casting it
automatically?
//create JPG in memory and upload it
public void saveJPG(){
BufferedImage buffered =
makeBufferedImage(backbuffer,BufferedImage.TYPE_INT_RGB);
String domain = "
www.lskatz.com";
String file = "xxxx/xxxx/upload.php";
try{
URL uploadPageURL = new URL("http", domain, 80, file);
HttpURLConnection urlConnection =
(HttpURLConnection)uploadPageURL.openConnection();
urlConnection.setRequestMethod("POST");
OutputStream output = urlConnection.getOutputStream();
ImageIO.write(buffered, "jpg", output); //need RenderedImage
}
catch (IOException e) {}
}