This week's book giveaway is in the Agile forum.
We're giving away four copies of Head First Agile and have Andrew Stellman & Jennifer Greene on-line!
See this thread for details.
Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

saving an image via an url  RSS feed

Martin Thorpe
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I am a newbie to Java, so please bear with me.

I am working on an image app. What I have achieved is to load an image, affect it (brightness, scale etc) and then save it to the local HD as a Jpg... no problems and I am impressed with the way Java deals with this.

Now I am trying to save the image via an URL, or upload it to a server via the http proxy. I have managed to communicate over http, but am having problems sending an image.

I have seen posts here where an image is loaded over an url, but written via one. Code follows.

this code is saving to the HD no problem:

This is the code I have tried to write the image, but I am sure I am missing something as I am not creating a file, just trying to output to the stream... which I am sure is wrong:

thanks for taking the time to read this post, hope someone can point me in the right direction.

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!