Delphi XE2 DataSnap REST - "Out of memory" when I try to upload a large file

I created a simple DataSnap REST server in Delphi XE2, and I have a method that returns a TStream object to transfer a file. This works well, but when I try to upload a large file (~ 2.5 GB), I got

"out of memory"

server side.

I would like to download the file through an internet browser ( http: // localhost: 8080 / datasnap / rest / TServerMethods1 / GetFile ).

Can rest service return large files?

I read this question and tried this solution, which works well when I use a small file.

Here is my simple code:

function TServerMethods1.GetFile: TStream;
var
  FileStream: TFileStream;
begin
  FileStream := TFileStream.Create('d:\file.exe', fmOpenRead);
  Result := FileStream;
end;

How can I download a large file from a REST server through an Internet browser?

+3
1
+2

All Articles