• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
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]
 
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic