You are not logged in.
Pages: 1
Hello there. I am a new user of mormot. In my program, I am sending files, sqlite database and sending text messages. I want to do it using Mormot. I learned a little bit and did it using the forum for sqlite and message. I can not send files. I've reviewed the demos.
1- Do I need to use a separate server for each service? (httpserver)
2- There is nowhere a comprehensive demo or sample for submitting files.
I am sorry for my English.
Offline
you should send files as rawbytestring. example:
// sample interfaced api code
TExampleApi = class(TInjectableObjectRest, IExampleApi)
public
procedure uploadfile(const rawfile: RawByteString);
end;
implementation
procedure TExampleApi.sendfile(const rawfile: RawByteString);
begin
FileFromString(base64toBin(rawfile), FilePath, true, FileDate);
end;
// sample usage
Apclient.ExampleApi.sendFile(BinToBase64(StringFromFile("C:\examplefile.png")));
Offline
I am getting an error. i guess i couldn't
I am sory. I deleted code.
I want an example that can help.
Last edited by Onur2x (2020-09-17 21:15:02)
Offline
Please follow the forum rules, don't put code in forum threads directly.
Especially if the code is not complete. There are missing the initialization part of your services.
So please create a gist of ready-to-reproduce sample of your problem.
Anyway, a contract error is likely to be either not the same interface, or the same service execution mode (e.g. sicShared or sicClientDriven on both sides).
Offline
Pages: 1