NodeMCU ESP8266 Getting data from html page to flash them in spiffs

Hi! First time here....

I have a problem, where I don't know how to get data from web side of the ESP to the SPIFFS.

I have a textarea on the "index.html" file loaded from the SPIFFS and I need to get somewhat the data from it and write them to the "times.txt" file in the SPIFFS.

Here is the code for the ESP: https://pastebin.com/M2pW7hUu
Here is the code for the index.html: https://pastebin.com/QKUMJ96h

I don't know hot to get it there, but I know it has to do with some POST or GET and if the data would get somewhat to a string in the code, I know how to get the string to the SPIFFS but not how to get the data from the textarea to the string in the code.

Thanks in any help.

Not sure to understand what you want exactly. If you want to get some text from the content of a website, have a look here. Basically, what you want is here :

HTTPClient http;  //Declare an object of class HTTPClient
 
http.begin("http://jsonplaceholder.typicode.com/users/1");  //Specify request destination
int httpCode = http.GET();                                  //Send the request
 
if (httpCode > 0) { //Check the returning code
 
String payload = http.getString();   //Get the request response payload
Serial.println(payload);             //Print the response payload

The String payload is filled with the content of the website, you just need to search for what you want to get from it. Look at the methods of the String class.

If it's not what you're looking for, please explain it again... :confused:

okokokok I will try again.

The ESP hosts a website (index.html) where using JavaScript it generates few times and puts them into textarea. Now I need to somehow get the text from the textarea what the page generated and get it into String in the code so I can rewrite the date in SPIFFS on ESP.

So something like, you press a button on the page, it makes GET or POST request for the ESP, that it can take it from the POST body and put it in the String, so the ESP can afterwards write it to SPIFFS.

Hope it helps