Transfert de données vers document txt

Bonjour,j'aurais besoin d'aide pour mon projet de terminal sti2d, actuellement je me suis basé sur un tutoriel qui me permet d'ouvrir une page html (presente dans la carte sd) et de transférer tout le texte tapé dans la page html vers la console arduino,j'aimerais savoir s'il est possible une fois le texte transférer de le stocker dans un document texte automatiquement.
J'utilise actuellement une carte leonardo ETH et ma carte est directement reliée à mon pc via câble ethernet
Mon code:

#include <SPI.h>
#include <Ethernet2.h>
#include <SD.h>
#define REQ_BUF_SZ   90
#define TXT_BUF_SZ   50


byte mac[] = { 0x90, 0xA2, 0xDA, 0x10, 0x16, 0x52 };
IPAddress ip(192, 168, 1, 10);   
EthernetServer server(80);       
File webFile;                    
char HTTP_req[REQ_BUF_SZ] = {0}; 
char req_index = 0;              
char txt_buf[TXT_BUF_SZ] = {0};  

void setup()
{
    pinMode(10, OUTPUT);
    digitalWrite(10, HIGH);
    
    Serial.begin(115200); 
      while (!Serial) {
  }
    Serial.println("Initializing SD card...");
    if (!SD.begin(4)) {
        Serial.println("ERROR - SD card initialization failed!");
        return; 
    }
    Serial.println("SUCCESS - SD card initialized.");
    if (!SD.exists("index.htm")) {
        Serial.println("ERROR - Can't find index.htm file!");
        return;
    }
    Serial.println("SUCCESS - Found index.htm file.");
    
  Ethernet.begin(mac, ip);
  Serial.print("Etat ");
  server.begin();
  Serial.print("Serveur: ");
  Serial.println(Ethernet.localIP());


}

void loop()
{
    EthernetClient client = server.available();

    if (client) { 
        boolean currentLineIsBlank = true;
        while (client.connected()) {
            if (client.available()) {  
                char c = client.read(); 
                if (req_index < (REQ_BUF_SZ - 1)) {
                    HTTP_req[req_index] = c;
                    req_index++;
                }
                if (c == '\n' && currentLineIsBlank) {
                    client.println("HTTP/1.1 200 OK");
                    if (StrContains(HTTP_req, "ajax_inputs")) {
                        client.println("Content-Type: text/xml");
                        client.println("Connection: keep-alive");
                        client.println();
                        if (GetText(txt_buf, TXT_BUF_SZ)) {
                          Serial.println("\r\nReceived Text:");
                          Serial.println(txt_buf);
                        }
                    }
                    else {  
                        client.println("Content-Type: text/html");
                        client.println("Connection: keep-alive");
                        client.println();
                        webFile = SD.open("index.htm");
                        if (webFile) {
                            while(webFile.available()) {
                                client.write(webFile.read());
                            }
                            webFile.close();
                        }
                    }
                    req_index = 0;
                    StrClear(HTTP_req, REQ_BUF_SZ);
                    break;
                }
                if (c == '\n') {
                    currentLineIsBlank = true;
                } 
                else if (c != '\r') {
                    currentLineIsBlank = false;
                }
            } 
        } 
        delay(1);      
        client.stop();
    } 
}
boolean GetText(char *txt, int len)
{
  boolean got_text = false;    
  char *str_begin;             
  char *str_end;               
  int str_len = 0;
  int txt_index = 0;
  

  str_begin = strstr(HTTP_req, "&txt=");
  if (str_begin != NULL) {
    str_begin = strstr(str_begin, "=");  
    str_begin += 1;                      
    str_end = strstr(str_begin, "&end");
    if (str_end != NULL) {
      str_end[0] = 0;  
      str_len = strlen(str_begin);
      for (int i = 0; i < str_len; i++) {
        if (str_begin[i] != '%') {
          if (str_begin[i] == 0) {
            break;
          }
          else {
            txt[txt_index++] = str_begin[i];
            if (txt_index >= (len - 1)) {
              break;
            }
          }
        }
        else {
          if ((str_begin[i + 1] == '2') && (str_begin[i + 2] == '0')) {
            txt[txt_index++] = ' ';
            i += 2;
            if (txt_index >= (len - 1)) {
              break;
            }
          }
        }
      }
      txt[txt_index] = 0;
      got_text = true;
    }
  }

  return got_text;
}

void StrClear(char *str, char length)
{
    for (int i = 0; i < length; i++) {
        str[i] = 0;
    }
}

char StrContains(char *str, char *sfind)
{
    char found = 0;
    char index = 0;
    char len;

    len = strlen(str);
    
    if (strlen(sfind) > len) {
        return 0;
    }
    while (index < len) {
        if (str[index] == sfind[found]) {
            found++;
            if (strlen(sfind) == found) {
                return 1;
            }
        }
        else {
            found = 0;
        }
        index++;
    }

    return 0;
}

La page html :

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Text Box using textarea</title>
        <script>

        strText = "";
        
        function SendText()
        {
            nocache = "&nocache=" + Math.random() * 1000000;
            var request = new XMLHttpRequest();
            
            strText = "&txt=" + document.getElementById("txt_form").form_text.value + "&end=end";
            
            request.open("GET", "ajax_inputs" + strText + nocache, true);
            request.send(null);
        }
        </script>
    </head>

    <body onload="GetArduinoIO()">
        <form id="txt_form" name="frmText">
            <textarea name="form_text" rows="10" cols="40"></textarea>
        </form>
        <input type="submit" value="Send Text" onclick="SendText()" />
    </body>

</html>

Toujours à la recherche d'aide

Le document doit être stocker sur le PC ,donc le premier cas, existe-il un guide ou quel que chose de similaire pour substitue la console ?

Je t'avoue ne pas trop m'y connaitre, merci pour la piste je vais creuser et voir ce que je peux en faire.