Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to upload a file on webserver using midlet and servlet

 
Mahesh sharma
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
i want to upload a video file using midlet to webserver.
can anyone tell me is that possible to do this type of implementation./
thanks
mahesh
 
David Price
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on the webserver.
If you control the webserver and you can run e.g. Java servlets on it, then write a MIDlet that sends the file's bytes using an HTTP Connection (HTTP method 'POST'), and a servlet that receives the bytes in its doPost method.
If you don't control the webserver but it has some HTTP Forms interface for uploading files (as does e.g. Geocities), your MIDlet may be able to emulate a web browser and upload a file through the same system. This is tricky; start by reading this stuff on multipart/form-data encoding. You may also have to figure out how to 'log in' to the server first.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!