Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

Uploading Image from Java Desktop App to Server

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,.....
 
Sheriff
Posts: 22753
130
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes got it correct with HttpClient and FileUpload.....thanks for the suggestion.....
 
Rob Spoor
Sheriff
Posts: 22753
130
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic