Jump to content

xorpas

Members
  • Content Count

    94
  • Joined

  • Last visited

Posts posted by xorpas


  1.  i have an issu with FireDac  it store  Arabic characters as  question marks (???)

    code create database at runtime is 

    var
      SQL: string;
      FConnection: TFDConnection;
    begin
      FConnection := TFDConnection.Create(nil);
      FConnection.DriverName := 'SQLite';
      FConnection.Params.Add('OpenMode=CreateUTF8');
      FConnection.Params.Add('CharacterSet=UTF8');
      FConnection.Params.Database := DB;
      FConnection.Open;
      SQL := 'CREATE TABLE Contact (ID INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT, Phone TEXT, Img BLOB)';
      FConnection.Open;
      FConnection.ExecSQL(SQL);
      FConnection.Close;

    and insert is 

    Connection := TFDConnection.Create(nil);
      Connection.DriverName := 'SQLite';
      Connection.Params.Database := DB;
      Connection.Params.Add('OpenMode=CreateUTF8');
      Connection.Params.Add('CharacterSet=UTF8');
      Connection.Open;
      Query := TFDQuery.Create(nil);
      Query.Connection := Connection;
     
      begin
        Query.SQL.Text :=
          'INSERT INTO Contact (Name, Phone, Img) VALUES (:Name, :Phone, :Img)';
        if Param[0] = '' then
          exit;
        if Param[1] = '' then
          exit;
        begin
         Query.ParamByName('Name').AsString := (Param[0]);
          Query.ParamByName('Phone').AsString := Param[1];
          stream := TMemoryStream.Create;
          if Param[2] = 'nil' then
          begin
    
          end
          else
          begin
            stream.LoadFromFile(Param[2]);
            Query.ParamByName('Img').LoadFromStream(stream, ftBlob);
          end;
    
          Query.ExecSQL;
          stream.Free;
        end;
    
      end;

    help to solve this issue

     

    Untitled.png.0e0500aa76d2bd2e2cee5f47a13f7973.png


  2. I resolve it by add code international at first of phone number  but still not work   get this error   

    {
      "error": {
        "code": 400,
        "message": "MISSING_REQ_TYPE",
        "errors": [
          {
            "message": "MISSING_REQ_TYPE",
            "domain": "global",
            "reason": "invalid"
          }
        ]
      }
    }


  3. hey 

    i have an issue with firebase send verification code   

     

    format('https://www.googleapis.com/identitytoolkit/v3/relyingparty/sendVerificationCode?key=%s',[FIREBASE_API_KEY])

     the respense  is 

    {
      "error": {
        "code": 400,
        "message": "MISSING_CLIENT_IDENTIFIER",
        "errors": [
          {
            "message": "MISSING_CLIENT_IDENTIFIER",
            "domain": "global",
            "reason": "invalid"
          }
        ]
      }
    }
    i can not found CLIENT_IDENTIFIER in firebase project setting

     


  4. On 2/7/2023 at 6:40 PM, mytbo said:

    No, you are using the wrong libcurl DLL. Please download the file only from the official site and do not use any other source. Here is the link to the Windows download. The file for curl for 32-bit has the name curl-7.87.0_4-win32-mingw.zip and SHA256: ef8730e31245ef138aba1e3f02ae02e3fce435ec89177d7c8b05de5ce3c07891. The libcurl DLL has the modification date: Wednesday, December 21, 2022, 07:05:38. File size is 4,405,320 byt

    With best regards

    Thomas

    Thank you mr Thomas It work now thank's for your time :classic_love:


  5. On 2/5/2023 at 9:02 PM, mytbo said:

    The all-purpose solution is Curl. The curl.exe program is part of current Windows versions. Links: GitHub, Download, Manual, libcurl C API and libcurl C examples. An encapsulation for libcurl DLL can be found in the mORMot unit mormot.lib.curl. The mORMot library does not need to be installed. Download the current commit and the static binaries from the last tag directory. Set the appropriate library and search paths in Delphi. This pattern helps to create them:

    
    // Simply replace the colons with the save path
    ..\src;..\src\app;..\src\core;..\src\crypt;..\src\db;..\src\lib;..\src\misc;..\src\net;..\src\orm;..\src\rest;..\src\script;..\src\soa;..\src\tools\ecc;..\src\ui;

    For many use cases you can find a template in the libcurl C examples. The following Delphi example shows the implementation for a download:

    
    uses
      mormot.core.base,
      mormot.core.text,
      mormot.core.os,
      mormot.lib.curl;
    
    var
      hnd: TCurl;
      url: RawUtf8;
      res: TCurlResult;
      buffer: RawByteString;
      responseSize: Int64;
    begin
      if not CurlIsAvailable then Exit; //=>
    
      hnd := curl.easy_init;
      if hnd <> Nil then
      begin
        url := 'https://icons8.com/icons/set/home.html';
        curl.easy_setopt(hnd, coURL, Pointer(url));
        curl.easy_setopt(hnd, coSSLVerifyPeer, 0);
        curl.easy_setopt(hnd, coSSLVerifyHost, 0);
        curl.easy_setopt(hnd, coWriteFunction, @CurlWriteRawByteString);
        curl.easy_setopt(hnd, coWriteData, @buffer);
        res := curl.easy_perform(hnd);
        if res = crOk then
        begin
          FileFromString(buffer, MakePath([Executable.ProgramFilePath, 'home.html']));
          
          curl.easy_getinfo(hnd, ciSizeDownloadT, responseSize);
          ShowMessage(Format('Download completed: %s', [KB(responseSize)]));
        end
        else
          ShowMessage(Format('Curl told us %d (%s)', [Ord(res), curl.easy_strerror(res)]));
    
        curl.easy_cleanup(hnd);
      end;
    end;

    An example to study is also the class TCurlHttp from the unit mormot.net.client.

     

    With best regards

    Thomas

    Thank's Mr thomas Not work for me see this image

     

    Untitled.thumb.png.4e2d88d65172f5cb0e8099e442703667.png

    can you upload the work project to test it

     

     


  6. Hello

    when I try to get this link Link  with this headers

    Host: apk-dl.com
    
    User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0
    
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
    
    Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
    
    Accept-Encoding: gzip, deflate, br
    
    Connection: keep-alive
    
    Upgrade-Insecure-Requests: 1
    
    Sec-Fetch-Dest: document
    
    Sec-Fetch-Mode: navigate
    
    Sec-Fetch-Site: none
    
    Sec-Fetch-User: ?1
    
    Sec-GPC: 1

    using tnethttpclient  like this

     

    http := TNetHTTPClient.Create(nil);
          http.UserAgent :=
            'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0';
          http.SecureProtocols := [THTTPSecureProtocol.TLS12];
          http.Accept :=
            'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8';
          Memo2.Text := link;
          http.CustomHeaders['Host:'] := 'apk-dl.com';
          http.CustomHeaders['Accept-Language:'] :=
            'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3';
          http.AcceptEncoding := 'gzip, deflate, br';
          http.CustomHeaders['Connection:'] := 'keep-alive';
          http.CustomHeaders['Upgrade-Insecure-Requests:'] := '1';
          http.CustomHeaders['Sec-Fetch-Dest:'] := 'document';
          http.CustomHeaders['Sec-Fetch-Mode:'] := 'navigate';
          http.CustomHeaders['Sec-Fetch-Site:'] := 'none';
          http.CustomHeaders['Sec-Fetch-User:'] := '?1';
          http.CustomHeaders['Sec-GPC:'] := '1';

     

    I get 400 Bad Request ,nginx/1.14.0

    <html>
    <head><title>400 Bad Request</title></head>
    <body bgcolor="white">
    <center><h1>400 Bad Request</h1></center>
    <hr><center>nginx/1.14.0</center>
    </body>
    </html>

    but when send it with httpliveheader to firefox I get success result

     

    How can resolve this


  7. hello,

     

    I need to extract a group from text But I not fammiliar with regex ,Need some one to help me with Please this is what I got

    Untitled.thumb.png.0bf952a43539626c06b84130e67ab6ca.png

     

    and this my used pattern

     

    <li><strong>([^<]*)</strong></li>.*?</ul>.*?download-pill" href="([^"]*)">([^<]*)</a></p>

    text hier

     

     

    <hr />
    <ul>
    <li><strong>خالد المشيقح:</strong></li>
    </ul>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/01.mp3">شرح التسهيل 1 </a></p>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/02.mp3">شرح التسهيل 2 </a></p>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/03.mp3">شرح التسهيل 3</a></p>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/04.mp3">شرح التسهيل 4</a></p>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/05.mp3">شرح التسهيل 5 </a></p>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/06.mp3">شرح التسهيل 6</a></p>
    <ul>
    <li><strong>عبدالسلام الشويعر:</strong></li>
    </ul>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/07.mp3">شرح التسهيل 7</a></p>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/08.mp3">شرح التسهيل 8 </a></p>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/09.mp3">شرح التسهيل 9 </a></p>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/10.mp3">شرح التسهيل 10</a></p>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/11.mp3">شرح التسهيل 11 </a></p>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/12.mp3">شرح التسهيل 12 </a></p>
    <ul>
    <li><strong>سامي الصقير:</strong></li>
    </ul>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/13.mp3">شرح التسهيل 13 </a></p>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/14.mp3">شرح التسهيل 14 </a></p>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/15.mp3">شرح التسهيل 15</a></p>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/16.mp3">شرح التسهيل 16</a></p>
    <p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/17.mp3">شرح التسهيل 17 </a></p>
    <hr />

     


  8. Thank you and I am sorry for that, The two rectangle is in form2 and when I add from the form1 i add just a rectangle 1 and two without form2 Like a first project  added I create  a form on vertscrollbox like this

     

    procedure Tbox.Fillbox(Name: string);
    var
      fm: TForm2;
    
    begin
    
      fm := TForm2.Create(self);
      fm.Rectangle1.Position.X := fm.Rectangle1.Height + 1;
      fm.text1.Text := name;
    
      self.AddObject(fm.Rectangle1);
    
    
    end;

     

     

×