Jump to content

Need UniFileUpload > 10GB


billyChou

Recommended Posts

You can use this approach:

http://jira.fmsoft.net/servicedesk/customer/portal/4/FSD-672

procedure TWebDataModule.IdHTTPServer1CreatePostStream(AContext: TIdContext; AHeaders: TIdHeaderList;
 var VPostStream: TStream);
var
 Length: int64;
begin
 Length := StrToInt64Def(AHeaders.Values['Content-Length'], 0);
 if Length > 20000000 then
  VPostStream := TFileStream.Create(GetTempFile, fmCreate)
 else
  VPostStream := TMemoryStream.Create;
end;

And after upload is nedded to free stream:

 if ARequestInfo.PostStream is TFileStream then
   begin
    FileName := (ARequestInfo.PostStream as TFileStream).FileName;
    ARequestInfo.PostStream.Free;
    ARequestInfo.PostStream := nil;
   end;

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...