Home > Back-end >  Datasnap strange issue in the rest of don't know is such design is still my own problem!!
Datasnap strange issue in the rest of don't know is such design is still my own problem!!

Time:10-02

Use the wizard to create a datasnap rest service, the service side write a method used to return the memory flow, the following code
The function TServerMethods. DownLoadFile (AFileName: string) : TMemoryStream;
The begin
If FileExists (AFileName) then
The begin
Result:=TMemoryStream. Create;
Result. The LoadFromFile (AFileName);
The end;
The end;
To build a VCL app use idhttp to invoke this method, when idhttp after downloading the file, actually this server module will not release, if the server-side method is to return to the simple data types, such as integer, string, etc., after the client calls, the server module is automatically released, the server is set to the Invocation, if anyone has the environment, help me to test, or tell me the solution, xe5 xe6 and such

CodePudding user response:

Hey, how no one
  • Related