• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need help porting a CURL PUT uploader to java servlet (httpput possibly?)

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have been googling for many hours trying to find some info on how to do this..

What I have is a php uploader example for posting videos to a (ooyala.com) server.
My app has a tomcat backend with various servlets for doing POSTS, PUTS, etc..

I need to port the php/curl sample code over to a servlet.

This is the working php code:



But I am confused hot to acomplish this with HttpPut in my servlet because I dont know how to attach the video data.
Heres my servlet code:




All I really need is help with how to port that php/curl code to a java servlet..
I'm pretty much a newb at this stuff so it is still a bit confusing..
I hope someone in here can help me, I will be truly grateful!!

Thanks in advance,

-Tavis

 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So is this the same as submitting the upload form and calling a servlet? Or have PHP do some stuff then call a servlet?

The first one can be done by using tomcat connector AJP (forwarding the request to servlet container from apache web server). Under this approach your entire upload processing logic is done in the servlet.

If the latter, PHP does have ability to call Java programs but this is still experimental. So I don't recommend it. Under this approach, the java does not need to be a servlet. http://www.php.net/manual/en/java.examples.php
 
reply
    Bookmark Topic Watch Topic
  • New Topic