Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Uploading Image from Java Desktop App to Server  RSS feed

 
Sandip Gupta
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a desktop application within which i know which image file is to be uploaded....to a server...The desktop application has the following code which sends a request to servlet on the server. The servlet needs to receive the image and save it to a folder on the server.....


//Code on client machine





//my servlet code




However...there is something wrong....I guess i am not processing the request properly...I have tried saving the image file using url and it works fine.....can some one guide me ...on how to receive a request and process it as image and save it to disk.....However if please point out if there is any error with the code on the client desktop application,.....
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd use Apache Commons HttpClient and FileUpload libraries to do the dirty work for you.
 
Sandip Gupta
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes got it correct with HttpClient and FileUpload.....thanks for the suggestion.....
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!