| Author |
Extracting Content from HTTP Post?
|
Sachin Dere
Ranch Hand
Joined: Jan 14, 2003
Posts: 80
|
|
Hi Guys, I need to extract COntent ex gif,mid files from HTTP Post.The content is in the body of HTTP Post which is being posted to my servlet by the Telco. How do i get this content in physical format? ex read the content and store it in cat.gif and cat.mid etc? I need to use Base64 encoding Please help me if anyone knows how to do it really appreciate it thanks,
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
There is the sun.misc.BASE64Encoder but it's undocumented and Sun recommends against using any classes in the sun.* package. http://java.sun.com/products/jdk/faq/faq-sun-packages.html Googling on 'sun.misc.BASE64Encoder' will yield both alternatives and, in some cases, the actual code to roll your own. As for getting the post to begin with, look at the getInputStream method of the ServletRequest interface: http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletRequest.html #getInputStream()
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Gowrishankar Mudaliar
Ranch Hand
Joined: Oct 20, 2001
Posts: 39
|
|
You can read the binary contents of your file without base64 by setting the mime type in the form as multipart/form-data and read the contents in the servlets. This is how file-uploads and email attachments work in web-based applications. I am not sure if they are precisely applicable to your requirements.
|
 |
Sachin Dere
Ranch Hand
Joined: Jan 14, 2003
Posts: 80
|
|
Hi guys, thanks for the reply. will work on it and will let u know cheers,
|
 |
 |
|
|
subject: Extracting Content from HTTP Post?
|
|
|