#1 mORMot 2 » Fix bug in OpenSslLoad » 2024-06-19 12:46:21

EMartin
Replies: 1

Hi @ab, I found a bug in the function mormot.crypt.openssl.OpenSslLoad.

function OpenSslLoad(const Cert: RawByteString): ICryptCert;
var
  x: PX509;
  der: RawByteString;
begin
  result := nil;
  der := PemToDer(Cert);
  if not AsnDecChunk(der) then // basic input validation !!! HERE, the parameter must be `der` instead of `Cert`
    exit;
  x := LoadCertificate(der);
  if x <> nil then
    result := CryptCertOpenSsl[X509Algo(x)].FromHandle(x);
end;

#2 mORMot 2 » Identifiers redeclared when OPENSSLFULLAPI is defined » 2024-04-23 14:09:47

EMartin
Replies: 1

Hi, using mormot.crypt.openssl.pas and mormot.lib.openssl11.pas with OPENSSLFULLAPI enabled and compiling too much errors Identifier redeclared: 'NID_info_access' and similars are raised. I commented on the redeclared.

UPDATE:

Missing record definition in mormot.lib.openssl11.full.inc

  x509_val_st = record
    notBefore: PASN1_TIME;
    notAfter: PASN1_TIME;
  end;

UPDATE 1:
In mormot.lib.openssl11.pas the OPENSSLSTATIC is not defined if OPENSSLFULLAPI is defined.

const
  // some binaries may be retrieved from https://github.com/grijjy/DelphiOpenSsl
  // or http://wiki.overbyte.eu/wiki/index.php/ICS_Download (more up-to-date)
  // - on Windows, we found out that ICS OpenSSL 3 is slower than OpenSSL 1.1
  {$ifdef OSWINDOWS}
    {$ifdef CPU32}
    LIB_CRYPTO1 = 'libcrypto-1_1.dll';
    LIB_SSL1 = 'libssl-1_1.dll';
    LIB_CRYPTO3 = 'libcrypto-3.dll';
    LIB_SSL3 = 'libssl-3.dll';
    _PU = '';
    {$else}
    LIB_CRYPTO1 = 'libcrypto-1_1-x64.dll';
    LIB_SSL1 = 'libssl-1_1-x64.dll';
    LIB_CRYPTO3 = 'libcrypto-3-x64.dll';
    LIB_SSL3 = 'libssl-3-x64.dll';
    _PU = '';
    {$endif CPU32}
    {$ifdef OPENSSLFULLAPI}     // 
      {$define OPENSSLSTATIC}  // with this is working
    {$ENDIF OPENSSLFULLAPI}  //
  {$else}
  ...

UPDATE 2: in mormot.lib.openssl11.inc close bracket is in wrong position.

//function BIO_meth_get_write(p1: PBIO; p2: PUTF8Char; p3: Integer; biom: PBIO_METHOD): integer;
{ TODO : Cannot convert original type "int (*)(BIO *, const char *, int)" }; cdecl; //HERE
//  external LIB_CRYPTO name _PU + 'BIO_meth_get_write';

//function BIO_meth_get_write_ex(p1: PBIO; p2: PUTF8Char; p3: PtrUIntp4: PPtrUInt; biom: PBIO_METHOD): integer;
{ TODO : Cannot convert original type "int (*)(BIO *, const char *, size_t, size_t *)" }; cdecl; //HERE
//  external LIB_CRYPTO name _PU + 'BIO_meth_get_write_ex';

Commented with

//TODO: Cannot convert original ...

are with close bracket in wrong position.

There is much more compiler errors.

Thanks.

#3 Re: mORMot 2 » ACME example » 2024-04-22 19:37:37

Thanks @chaa, first I'll try with http-01.

#5 mORMot 2 » ACME example » 2024-04-19 17:37:31

EMartin
Replies: 4

Hi, after a long time I back to write a post, I want to know if is there any example/demo of ACME.

And, it's supported DNS challenge ?

Thanks in advance.

Esteban

#6 Re: mORMot 1 » Stop the war! » 2022-02-27 15:47:15

I'm so sorry Pavlov. I'm from Argentina and our government is a shame, they are pro russian because they are corrupts like any populist government and need money from China and Russia and they only make a weak opposition to Putin's genocidal attack. Many people from my country are with your. I just wait that the world rest can help to Ukraine.

#7 Re: mORMot 1 » Firebird transactions » 2021-04-19 11:27:34

Check if you is doing commit retaining instead of hard commit.

#8 Re: mORMot 1 » _Jsonfast » 2020-12-17 13:42:22

Double escape "\", example:

{"ToAddress":"someaddress.gmail.com", "Attachment":"c:\\photos\\photo1.bmp"}

#9 Re: mORMot 1 » Renaming TSQLRecord to TORM » 2020-10-30 12:10:13

I agree with prefixing the framework with TSyn*, historically Delphi third party frameworks have used this. Even more, functions and procedure they should have a prefix, but thats is more complex for compatibility. It's just another opinion.

#10 Re: mORMot 1 » Renaming TSQLRecord to TORM » 2020-10-26 18:52:27

The new name is perfect for me. Have much make sense.

#11 Re: mORMot 1 » Duplicate entry error compiling with Laz/FPC » 2020-07-01 15:40:59

ok, @ab patched the @mpv pull request, the @ab speed is as warp 9 in Star Trek (and @mpv too).

#13 Re: mORMot 1 » Duplicate entry error compiling with Laz/FPC » 2020-07-01 12:47:54

Thanks @mpv, unfortunately our target development is Windows and I want migrate from Delphi 4 to FPC/Lazarus but with this limitation cannot will be possible.

#14 mORMot 1 » Duplicate entry error compiling with Laz/FPC » 2020-06-29 14:59:37

EMartin
Replies: 5

Hi @ab, I tried compile LogView.lpi with Laz 2.0.8/FPC 3.2.0 and have error in SynMemoEx.pas:

const
  RAEditorCompletionChars: set of AnsiChar =
    [#8, '_', '0'..'9', 'A'..'Z', 'a'..'z'];
  Separators: set of AnsiChar =
    [#0, ' ', '-', #13, #10, '.', ',', '/', '\', ':', '+', '%', '*', '(', ')',
    ';', '=', '{', '}', '[', ']', '{', '}', '|', '!', '@', '"']; 

the '{', '}' is duplicated.

UPDATE

  • SynMemoEx.pas(567,40) Error: Identifier not found "TCreateParams" in TCustomMemoEx in Laz 2.0.8 / FPC 3.2.0

  • With Delphi 10.3 no error is raised by the compiler (either duplicated entry and TCreateParams.

I thought that LogView was FPC/Windows compatible, my mistake.

Best regards.

#15 Re: mORMot 1 » Call stack - how to get? » 2020-06-09 13:39:15

I use TSynLog.Add.Log(all StackTrace, ...) and was very helpful.

#16 Re: mORMot 1 » 2tier to 3tier migration. AdoDataset -> RestDataset solution » 2020-05-19 13:27:14

Sure, I mean that the mORMot framework allow custom solutions, although I prefer to use mORMot features, RemObjects (my old version) also uses Indy and OpenSSL but the TWinHTTP is very superior.

#17 Re: mORMot 1 » 2tier to 3tier migration. AdoDataset -> RestDataset solution » 2020-05-19 13:10:37

I had similar needs but migrating from 3tier (with RemObjects) to 3tier (with mORMot). I implemented TSynRestDataset but using full mORMot features -not Indy, not OpenSSL, mORMot validators- (see https://synopse.info/forum/viewtopic.php?id=2712), we make small adaptations in out client applications (5, 10, 15 years) and all works fine. The mORMot framework greatness is infinite.

#19 Re: mORMot 1 » Contribution: TSynRestDataset » 2020-05-17 21:53:46

Yes, is what i am currently using with Delphi 7.

#22 Re: mORMot 1 » The mORMot on Android » 2020-05-03 15:21:53

Thank you @AOG !!! I'll investigate. One question: is needed asphyre for non graphical apps ?

#23 Re: mORMot 1 » The mORMot on Android » 2020-04-28 11:14:54

all tests passed !!! Congratulations AOG !!!

Can you suggest me tutorials for Android development with Lazarus/FPC ? I know that there is someones in the net, but I don't know the more reliable.

Thanks.

#24 mORMot 1 » Possible bug or limited feature in SynMustache » 2020-04-24 12:47:24

EMartin
Replies: 0

Hi @ab, I have a problem rendering mustache template:

Template

{{^context.video.main.parts}}-v error -y -i {{context.video.main.sourcefilename}} {{context.video.main.tempfilename}}.avi{{/context.video.main.parts}}
{{#context.video.main.parts}}
  {{#-first}}-v error -y -i {{context.video.main.sourcefilename}}{{/-first}}
  {{^-last}} -ss {{startoffsetinsecs}} -t {{durationinsecs}} {{tempfilename}}.avi {{/-last}}
  {{#-last}} -ss {{startoffsetinsecs}} {{tempfilename}}.avi{{/-last}}
{{/context.video.main.parts}}

Context (the context is a reduced version but same structure)

{
    "context": {
        "callrefid": "441299259001",
        "audio": {
            "main": {
                "sourcefilename": "\\TECNOVOZ\\ACD\\Vox\\20191217\\11285401.139",
                "parts": [],
                "tempfilename": "C:\\Users\\EMartin\\AppData\\Local\\Temp\\A~44129925900100",
                "destfilename": "\\TecnoVoz\\Streaming\\441299259001"
            },
            "holds": []
        },
        "video": {
            "main": {
                "sourcefilename": "\\TECNOVOZ\\ACD\\Video\\20191217\\01_0139_20191217_112854_0000000000.avi",
                "parts": [{
                        "startoffsetinsecs": 0,
                        "durationinsecs": 275.333,
                        "tempfilename": "C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900101"
                    }, {
                        "startoffsetinsecs": 275.666,
                        "durationinsecs": 60.3339999999999,
                        "tempfilename": "C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900103"
                    }, {
                        "startoffsetinsecs": 1152,
                        "durationinsecs": 0,
                        "tempfilename": "C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900115"
                    }
                ],
                "tempfilename": "C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900100",
                "destfilename": "\\TecnoVoz\\Streaming\\441299259001"
            },
            "holds": [{
                    "sourcefilename": "\\TECNOVOZ\\ACD\\Video\\20191217\\01_0139_20191217_112854_0000000000_01.avi",
                    "tempfilename": "C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900102"
                }, {
                    "sourcefilename": "\\TECNOVOZ\\ACD\\Video\\20191217\\01_0139_20191217_112854_0000000000_02.avi",
                    "tempfilename": "C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900104"
                }, {
                    "sourcefilename": "\\TECNOVOZ\\ACD\\Video\\20191217\\01_0139_20191217_112854_0000000000_06.avi",
                    "tempfilename": "C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900112"
                }
            ]
        }
    }
}

Result

[context] property not found in {"startoffsetinsecs":0,"durationinsecs":275.333,"tempfilename":"C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900101"}

When debugging I see try access to "startoffsetinsecs" starting from path "context.video.main.parts" and "context" not exists in array element {"startoffsetinsecs":0,"durationinsecs":275.333,"tempfilename":"C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900101"}.

Is this a bug or limited feature ?

Thanks.

#25 Re: mORMot 1 » Revision 2.x of the framework » 2020-03-09 12:09:06

I agree with @macfly, version 2 should be breaking change this way the migration will require the source code update.

on the other hand, ORM data response could be a class that could be replaced by other, for example for return in OData format ?

Thanks.

#26 Re: mORMot 1 » Compatibility problem between AESCBC 256 mORMot and C# » 2020-03-07 17:24:12

You mean that the text key always should be of 32 characteres ?

#27 Re: mORMot 1 » Compatibility problem between AESCBC 256 mORMot and C# » 2020-03-06 20:45:19

Hi @ab, I found the problem the compatibility (or not perhaps is by design):

in:

constructor TAESAbstract.Create(const aKey; aKeySize: cardinal);
begin
   if (aKeySize<>128) and (aKeySize<>192) and (aKeySize<>256) then
    raise ESynCrypto.CreateUTF8('%.Create(aKeySize=%): 128/192/256 required',[self,aKeySize]);
  fKeySize := aKeySize;
  fKeySizeBytes := fKeySize shr 3;
  MoveFast(aKey,fKey,fKeySizeBytes); <<<--- (1)
end;

(1) if the key is, for example, "12345678" the byte array TAESKey should be:

[49, 50, 51, 52, 53, 54, 55, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

in other words, the rest of array should be completed with zeroes but is filled with other values that are valids. For workaround I added Key as property in TAESAbstract with read/write and after create I refilling with correct data and it works.

Can you tell me if this behavior is by design or bug ?

UPDATE:
I removed Key property from TAESAbstract and implemented TAESAbstrackHack for accessing fKey protected member.
I don't know how patch MoveFast for non-filling with invalid values the rest of byte array. I think that Create constructor should have extra parameter with length of key text.

Thanks.

#28 Re: mORMot 1 » Revision 2.x of the framework » 2020-03-04 16:24:10

Thanks @ab, my intention is move to FPC but out base code is huge and much UI with DevEx and other visual third party components, all these tasks take time and we are very small team. We have not Delphi 2007 license.

#29 Re: mORMot 1 » Revision 2.x of the framework » 2020-03-04 13:28:36

I agree at all, except excluding Delphi 7 because all our projects are developed with it and, unfortunately, with third party components. I initiated conversations with my boss for migrating UI to web and use FPC as tool for backend development, but that's something that takes time. Maybe support for Delphi 7 for a few years (you decide how long) will be fantastic.

Excellent idea of use the semantic versioning.

Units splitting should be for functionality in my opinion, for example SynJSON with all related support for JSON handling.

Maybe this thread shoud be post as "sticky".

#30 Re: mORMot 1 » Compatibility problem between AESCBC 256 mORMot and C# » 2020-01-28 14:45:26

Thanks @ab, I'll try that the provider modify the algorithm, but in case that's not posible, how use TAESCBC to make the encryption as in C# ?.

Thanks again.

#31 Re: mORMot 1 » Compatibility problem between AESCBC 256 mORMot and C# » 2020-01-28 13:29:35

The text <b>pepego</b> with key <b>Aesdns06</b> works ok in https://dotnetfiddle.net/tlO25C and was generated with a C# application.

Any idea why mORMot encryption not working ?

Thanks.

#32 mORMot 1 » Compatibility problem between AESCBC 256 mORMot and C# » 2020-01-27 15:05:12

EMartin
Replies: 7

I need to generate a key using AES CBC 256 PKCS7 encryption for a .Net C# application that use this key for password when connection to database. The key have the form IV.KEY and is stored in a config file. I have the following code to generate the key in that way.

var
  lKey: TBytes;
  lIV: TAESBlock;
  lText, lTextEncrypted, lIVText: RawByteString;
  lAESCBC: TAESCBC;
begin
  ...
      // edtKey.Text is KEY
      // edtSource.Text is TEXT TO ENCRYPT
      SetLength(lKey, Length(edtKey.Text));
      SynCommons.HexToBin(Pointer(edtKey.Text), @lKey, Min(Length(edtKey.Text),SizeOf(lKey)));
      RawByteStringToBytes(RawByteString(edtKey.Text), lKey);
      lAESCBC := TAESCBC.Create(lKey, CRYPT_KEY_SIZES[2]{=256});
      try
        lText := StringToUTF8(edtSource.Text);
        TAESPRNG.Main.FillRandom(lIV);
        lAESCBC.IV := lIV;
        lTextEncrypted := SynCommons.BinToBase64(lAESCBC.EncryptPKCS7(lText));
        lIVText := SynCommons.BinToBase64(@lAESCBC.IV, SizeOf(lAESCBC.IV));
        edtDest.Text := UTF8ToString(lTextEncrypted)+'.'+lIVText;
      finally
        lAESCBC.Free;
      end;
  ...
end;

and the key generated with the above code

KEY=key
TEXT TO ENCRYPT=text to encrypt

oTfXA3+lm6aiOaGYjCsk+Q==.OX0qIq1iSEMhTdw/fl0ehg== (the dot is a separator)

raise an exception <b>Padding is invalid and cannot be removed.</b>

For testing I'm using dotfiddle.net in https://dotnetfiddle.net/tlO25C

What's wrong ?

Thanks.

#33 Re: mORMot 1 » Interfaced method syncronisation » 2019-12-20 14:37:16

sicShared works this way but then another mothods are also blocked.

Using lock/unlock inside the endpoint of interface service does not block other endpoints of the interface service.

#34 Re: mORMot 1 » Interfaced method syncronisation » 2019-12-18 18:31:37

We are using sicShared and when we need serialized access to somene services we use TSynLocker.Lock and TSynLocker.Unlock in a try .. finally.

#36 Re: mORMot 1 » Kingdom Driven Design principles » 2019-10-01 13:28:18

Very interesting !!! @ab is the new Martin Fowler ? big_smile

#38 Re: mORMot 1 » Error compiling in Lazarus/FPC » 2019-07-29 01:04:48

With FPC Fixes3.2 and Lazarus trunk it works.

#39 Re: mORMot 1 » Error compiling in Lazarus/FPC » 2019-07-28 02:36:38

It works with FPC Fixes3.2 and Lazarus Fixes2.0, not works with FPC 3.3.1 and Lazarus 2.1.

"It works" mean that when added the SynCommons unit and run the project no error is raised.

Thanks @hnb.

PD: Is usefull try with FPC Fixes3.2 and Lazarus 2.1.0 ?

#40 Re: mORMot 1 » Error compiling in Lazarus/FPC » 2019-07-26 11:35:12

Ok, I'll use "fixes3.2" option from fpcupdeluxe.

A pity, whenever I try to initiate a migration to FPC some problem of this kind happens. My boss considers that these open source software are unstable, I try to convince him otherwise.

Thanks.

#41 Re: mORMot 1 » Error compiling in Lazarus/FPC » 2019-07-26 11:09:35

Thanks @hnb, that solve this error compilation, but now I have another:

"External: SIGSEGV" in this line:

..
if fElemType<>nil then begin
    {$ifndef HASDIRECTTYPEINFO}
    // FPC compatibility: if you have a GPF here at startup, your 3.1 trunk
    // revision seems older than June 2016
    // -> enable HASDIRECTTYPEINFO conditional below $ifdef VER3_1 in Synopse.inc
    // or in your project's options
    fElemType := PPointer(fElemType)^; // inlined DeRef() <-- THIS LINE
    {$endif HASDIRECTTYPEINFO}
    {$ifdef FPC}
    if not (PTypeKind(fElemType)^ in tkManagedTypes) then
      fElemType := nil; // as with Delphi
    {$endif FPC}
  end;
end;
..

I understand the warning comment but I downloaded, with FPCUpDeluxe, the trunk version (Lazarus 2.1.0 and FPC 3.3.1) ergo the revision is not that old.

What happend now ?

Thanks

#42 mORMot 1 » Error compiling in Lazarus/FPC » 2019-07-25 21:19:28

EMartin
Replies: 10

Hi @ab, I'm starting try to use Lazarus/FPC. I have installed mORMot with FPCUpDeluxe, and I when added the unit SynCommons to default Lazarus project (after Lazarus is started) and when I compile I have the following error:

Compile Project, Target: D:\fpcupdeluxe\projects\project1.exe: Exit code 1, Errors: 1, Warnings: 5, Hints: 9
SynLZ.pas(652,18) Hint: Local variable "offset" does not seem to be initialized
SynLZ.pas(660,21) Warning: Local variable "cache" does not seem to be initialized
SynLZ.pas(723,7) Hint: Conversion between ordinals and pointers is not portable
SynLZ.pas(723,19) Hint: Conversion between ordinals and pointers is not portable
SynLZ.pas(724,10) Hint: Conversion between ordinals and pointers is not portable
SynLZ.pas(726,13) Hint: Conversion between ordinals and pointers is not portable
SynLZ.pas(728,9) Hint: Conversion between ordinals and pointers is not portable
SynLZ.pas(1196,51) Hint: Local variable "offset" does not seem to be initialized
SynLZ.pas(1286,69) Hint: Local variable "offset" does not seem to be initialized
SynLZ.pas(1325,18) Hint: Local variable "offset" does not seem to be initialized
SynLZ.pas(1333,21) Warning: Local variable "cache" does not seem to be initialized
SynCommons.pas(6661,23) Warning: Some fields coming after "" were not initialized
SynCommons.pas(13390,42) Warning: Some fields coming after "VType" were not initialized
SynCommons.pas(15038,56) Warning: Some fields coming after "VOptions" were not initialized
SynFPCTypInfo.pas(99,3) Fatal: Syntax error, "BEGIN" expected but "[" found

and the line in the unit is:

...
implementation

procedure FPCDynArrayClear(var a: Pointer; typeInfo: Pointer);
  [external name 'FPC_DYNARRAY_CLEAR'];
procedure FPCFinalizeArray(p: Pointer; typeInfo: Pointer; elemCount: PtrUInt);
  [external name 'FPC_FINALIZE_ARRAY'];
procedure FPCFinalize(Data: Pointer; TypeInfo: Pointer);
  [external name 'FPC_FINALIZE'];
procedure FPCRecordCopy(const Source; var Dest; TypeInfo: pointer);
  [external name 'FPC_COPY'];
procedure FPCRecordAddRef(var Data; TypeInfo : pointer);
  [external name 'FPC_ADDREF'];
...

I installed trunk version of Lazarus/FPC with FPCUpDeluxe 1.6.2x, using {$mode delphi}.

What am I doing wrong ?

Thanks.

#43 Re: mORMot 1 » Raising http 400 in Interface-Based Service » 2019-06-18 01:24:43

Try:

CurrentServiceContextServer.Error(400,'error message');

I don't remember the exact sintax.

#44 mORMot 1 » Small bug in SynDB.pas » 2019-06-11 17:02:33

EMartin
Replies: 1

Hi @ab, there is a small bug in SynDB.pas:

function TSQLDBConnectionPropertiesThreadSafe.CurrentThreadConnectionIndex: Integer;
var id: TThreadID;
    tix: Int64;
    conn: TSQLDBConnectionThreadSafe;
begin // caller made EnterCriticalSection(fConnectionCS)
  if self<>nil then begin
    ...
    result := 0;
--    while result<fConnectionPool.Count-1 do begin
++    while result<fConnectionPool.Count do begin
      conn := TSQLDBConnectionThreadSafe(fConnectionPool.List[result]);
      if conn.IsOutdated(tix) then // to guarantee reconnection
        fConnectionPool.Delete(result) else begin
        if conn.fThreadID=id then begin
          fLatestConnectionRetrievedInPool := result;
          exit;
        end;
        inc(result);
      end;
    end;
  end;
  result := -1;
end;

Just remove the -1 (minus one).

Thanks.

#46 mORMot 1 » Expired database connections not destroyed quickly » 2019-05-27 16:25:33

EMartin
Replies: 2

Hi @ab, I created a pull request https://github.com/synopse/mORMot/pull/ … -282564854. I found a problem when creating connections and the cause is that the expired connections are not destroyed quicly. I need create many connections because I need drop tables and this way avoid the error "object is in use".

If you are agree can you apply the PR ?.

Thanks.

#47 Re: mORMot 1 » multipart/form-data not implemented yet » 2019-05-14 16:20:07

No es un framework fácil y la documentación es buena pero hay que leer un poco el código, así lo aprendí. Igual te recomiendo que hagas en inglés las consultas, usá el Google Translator o DeepL Translator.

This is my code uploading files using interface based services using TSQLRestClientURI:

function UpLoadFiles(const aSourceFiles, aDestFolder: RawUTF8; out aNotUploadedFiles: RawUTF8): Boolean;
var
  I: Integer;
  lMultiPart: TMultiPartDynArray;
  lMultiPartFormData: RawUTF8;
  lMultiPartContentType: RawUTF8;
  lSourceFiles: TRawUTF8DynArray;
  lResp: RawUTF8;
begin
  Result := False;
  CSVToRawUTF8DynArray(aSourceFiles, ',', '', lSourceFiles);
  if Length(lSourceFiles)=0 then
    Exit;
  for I := 0 to Length(lSourceFiles)-1 do begin
    MultiPartFormDataAddFile(lSourceFiles[I], lMultiPart);
    if MultiPartFormDataEncode(lMultiPart, lMultiPartContentType, lMultiPartFormData) then
      // fClient = instance of TSQLRestClientURI and logged
     // change 'root' for your root
      fClient.URI(FormatUTF8('%/UpFile?path=%', ['root', aDestFolder]),
                             'POST', @lResp, @lMultiPartContentType, @lMultiPartFormData)
    else
      AddToCSV(lSourceFiles[I],aNotUploadedFiles);
  end;
  Result := True;
end;

Use as reference for using TWinHTTP.

Saludos.

#48 Re: mORMot 1 » SilentLogin from Web or Crossplatform interface type client » 2019-05-08 15:50:41

I use OnAuthenticationFailed event for automatic relogin

#49 Re: mORMot 1 » Lazarus package » 2019-05-07 14:31:24

I trying migrate from Delphi 7 to FPC 3.3.1 and Lazarus 2.1.0 (I don't know anything of Lazarus/FPC), the OPM is very interesting and I have two questions:

1) Is posible that every time @ab update mORMot it is uploaded to http://packages.lazarus-ide.org/ automatically as with github ?
2) Is posible put in the OPM package version the content the synopsecommit.inc ? This way the last update is knowed.

Thanks.

#50 Re: mORMot 1 » Template for generating Swagger-UI-JSON » 2019-02-28 16:45:11

Thanks @sevo.

I can assure that enumDescription is not filled in mORMotWrapper.pas and it's very likely the other types aren't either.

Board footer

Powered by FluxBB