Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Tavis Hord
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • 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

 
K. Tsang
Bartender
Pie
Posts: 3222
12
Android Java
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic