This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

POST data with a file upload  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am attempting to make a POST request to another servlet with a file upload. I have the code below but it is not working properly. I posted this in the servlet forum as I am trying to use one servlet to contact another.

I think all but the file writing is ok. The other data being written are all string fields and should be correct.

The service that I am posting to works fine. I have tested it independently with success. However, I can't seem to send the file and other through this code.

I actually don't need to pass the file. I have code that reads the file into a variable that can be passed.

However, I need to emulate the multipart form. How do I emulate the multipart form.

Can anyone verify that I am doing this correctly?



[ November 22, 2006: Message edited by: Christopher Jursa ]
[ November 22, 2006: Message edited by: Christopher Jursa ]
 
Christopher Jursa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I should add, the exception thrown by the servlet I am trying to contact is "Posted content type isn't multipart/form-data".
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!