How to POST large data to servlet?

VacantFish 2002-03-26 11:01:44
I want to use HTTP's POST method to send some very large and unknown length data to server. The servlet just receives the data and writes them to disk. The data may be larger than server's buffer size.
When the doPost method of my servlet is triggered, has all the content of the HTTP request been transferred to server side?

If so, how can I POST very large data by HTTP POST method?

If not, the calling to getInputStream() does open the valve to accept data. Am I right?

...全文
82 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
VacantFish 2002-04-01
  • 打赏
  • 举报
回复
After doing some test by myself, I have the conclusion:

1) TOMCAT will buffer the request before pass it to the servlet, so it's IMPOSSILBE to transfer large data synchronizly.

2)skyyoung's answer is helpfulless to me. the article in his URL just tell that using MIME multi-part can trasfer data by POST.

3) pdev's opnion is wrong. chunked model need tell the exact length of your data.
pdev 2002-03-27
  • 打赏
  • 举报
回复
May you can't transfer very large and unknown length data to server via POST, because the length of data is necessary for this protocol.
Perhaps you can use socket,or divide the data to some less package and then transfer with POST.
VacantFish 2002-03-27
  • 打赏
  • 举报
回复
The page at your URL cannot be displayed. IE's error message is:



The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

XML document must have a top level element. Error processing resource 'http://www.csdn.net/expert/topic/85/85336.xml?temp=.9261591'.


skyyoung 2002-03-26
  • 打赏
  • 举报
回复
http://www.csdn.net/Expert/TopicView.asp?id=85336&datebasetype=200101

23,407

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧