which library do you use for base64::encode(fb->buf, fb->len))and if it's String compatible, shouldn't that be after the "&image="what about memory available?
as a best practice rule, don't post snippets (Snippets R Us!)
J-M-L:
which library do you use for base64::encode(fb->buf, fb->len))and if it's String compatible, shouldn't that be after the "&image="what about memory available?
as a best practice rule, don't post snippets (Snippets R Us!)
if (camClient.connect(postHost, postHttpPort))
{
uint8_t num = 1;
String base64image = "id=7292&num=" + num + "&image=" + (base64::encode(fb->buf, fb->len));
//Serial.println(base64_encode_expected_len(fb->len) + 1); //Serial.println(base64image.length());
camClient.stop();
}
else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
How can i fix this?
Error: invalid operands of types 'const char*' and 'const char [8]' to binary 'operator+'
so image is a String holding “id=7292&num=12&image=”
base64image is a String (not sure why you feel you have to duplicate memory) the base 64 encoding (you never answered which library) of fb->buf (you never explained what’s in there) for fb->len bytes (you never explained where this comes from).
We don’t know what camClient is and how it’s initialized?
then you end up possibly sending
POST /test/image/post.php HTTP/1.0
Host: cloud.***.com
Accept: */*
User-Agent: Mozilla/5.0
Content-Length: [color=blue]<a size number here>[/color]
Content-Type: image/jpeg
<an empty line>
id=7292&num=12&image=[color=blue]<here the base64 info>[/color]
and close the connexion
have you tried manually to see if that HTML header/content works ?