My application runs on an ESP32-CAM. It takes pictures and stores to SPIFFS. Periodically SPIFFS is checked and if images are found: 1- The image is saved to a FTP server 2- The image is summited to a Web Service that returns some informations about the image 3- Values are saved to mySQL 4- The image is deleted from SPIFFS
To read the image from SPIFFS I use the following fragment of code:
String imageName = file.name();
imageBuffer = "";
while (file.available()){
imageBuffer += char(file.read());
}
The FTP transfer works perfectly with the following command:
ftp.WriteData((uint8_t*)imageBuffer.c_str(),imageBuffer.length());
The service the image is submited for analizes works OK if I use the command:
webClient.write(fb->buf,fb->len);
But as it is not usable in the current implementation of my project I am trying to work with:
webClient.write((uint8_t*) imageBuffer.c_str(), imageBuffer.length());
I get no errors in return but it just does not work and the web service at the destination returns nothing.
What Am I doing wrong?