I have a Delphi 10.1 Berlin Datasnap Server, that can\'t return Data packets (through a TStream) bigger than around 260.000 bytes.
I have programmed it following the
A workaround: run a HTTP server which serves requests for the big files. The code generates and stores the file as shown in your question, and returns its URL to the client:
https://example.com/ds/... -> for the DataSnap service
https://example.com/files/... -> for big files
If you already use Apache as reverse proxy, you can configure Apache to route HTTP GET requests to resources at /files/.
For more control (authentication), you can run a HTTP server (Indy based) on a different port which serves the requests to these files. Apache may be configured to map HTTP requests to the correct destination, the client will only see one HTTP port.