• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Send file using HTTP from thick application

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am writing a Java app (thick app) and I'd like to send
files to a web server using HTTP protocol. If you know how
to do it, I would very much appreciate if you can tell me.
I already have an example of sending files using ftp but
what I want to use is HTTP since the requirement of communication
is HTTP.
Thanks in advance,
Tom Tran
[email protected]
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to use HTTP to send file, you have to send it as a multipart request, Jason Hunter gave out some sample code on how to write a multipart request in his book Java Servlet Programming. You can make changes to his MultipartRequest class sample, and that should work.

Originally posted by tom tran:
Hi,
I am writing a Java app (thick app) and I'd like to send
files to a web server using HTTP protocol. If you know how
to do it, I would very much appreciate if you can tell me.
I already have an example of sending files using ftp but
what I want to use is HTTP since the requirement of communication
is HTTP.
Thanks in advance,
Tom Tran
[email protected]


 
tom tran
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by ming fan:
If you want to use HTTP to send file, you have to send it as a multipart request, Jason Hunter gave out some sample code on how to write a multipart request in his book Java Servlet Programming. You can make changes to his MultipartRequest class sample, and that should work.


Hi Ming:
Thanks for your response! I read the MultipartRequest class in Jason's Hunter book before. This class is used
for processing the HTTP request that you received in your servlet. So, although the class is useful, it is for server side
processing. What I am looking for is a way to construct an HTTP Request with file attachements that I can send to
the servlet (which in turn will use the MultipartRequest class above to unpackage it).
If you have information on what I need, please let me know right away. Sample code would be wonderful!!!
Many thanks,
Tom Tran
[email protected]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic