收到浏览器请求一个文件的信息,如何分段连续的返回数据给浏览器,例如文件大小50M,一次返回50K,直到传完断开连接
解决方案 »
- 那位大哥给歌richedit使用的例子或者文档
- 如何判断文件正在被使用
- delphi8.0
- txt导入access,如何使用分隔符,在线等待
- 在delphi里对SQL SERVER2000进行建立表,修改字段的操作。
- Delphi7在选择打开一个Project时总是缺省的打开C:\Program Files\Borland\Delphi7\Projects这个目录下,如果改Delphi7的设置,使打开时能
- 大家看看这个简单的问题
- 程序换肤问题!! 诚请高手指教!!
- 利用SQL语句,如何将西文双引号保存到数据库中?
- 一个程序已运行了,叫project1,有两个edit,如何求得edit的输入值啊!在线等,具体大师
- 关于数据库中工资表的年月如何成批修改?
- SetTimer的问题。
procedure TForm5.IdHTTPServer1CommandGet(AContext: TIdContext;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
begin
AContext.Connection.IOHandler.SendBufferSize := 50 * 1024;
AResponseInfo.ServeFile(AContext,FileName (*预发送的文件的文件名*) );
end;
AResponseInfo.ContentStream:=lStream;
AResponseInfo.WriteContent;
INDY开源的,你可以看他的处理流程
try
if ContinueProcessing then begin
DoCommandGet(AThread, LRequestInfo, LResponseInfo);//你执行的事件
end;
except
on E: Exception do begin
LResponseInfo.ResponseNo := 500;
LResponseInfo.ContentText := E.Message;
end;
end;
// Write even though WriteContent will, may be a redirect or other
if not LResponseInfo.HeaderHasBeenWritten then begin
LResponseInfo.WriteHeader;
end;
// Always check ContentText first
if (Length(LResponseInfo.ContentText) > 0)
or Assigned(LResponseInfo.ContentStream) then begin
LResponseInfo.WriteContent; //发出
end;