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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...