ERROR: cannot convert 'fs::SPIFFSFS' to 'const char*'

People,

The constat char* image = "https...." is the final part of a URL, and it works well, it shows the photo available at the web address.

What I'm trying is to override and have image = photo stored in SPIFFS from esp32-cam.

There will only be 1 photo there.

How do I make the image point to this photo ?

I didn't post the whole code because it's full of other useless things commented and because it's not relevant to this question.

const char* image = SPIFFS, "/image.jpg";
//  const char* image = "https://file-example.s3-accelerate.amazonaws.com/images/test.jpg";

Thanks

Then don't expect anyone to post the whole answer

If you don't want to post a large sketch then post a small but complete example of what you are trying to do

image inside the URL like this works:

url = ... + "&image=https://file-example.s3accelerate.amazonaws.com/images/test.jpg";

I just wanted &image to be the only photo I temporarily store inside SPIFFS

Do I need to convert the photo to base64 ?

Your error is not related to the file format, but your use of the const char * declaration.

The following two links should give you some idea how to work with files on SPIFFS:
^Filesystem — ESP8266 Arduino Core 3.1.0-8-g840ef782 documentation
^ESP32 Arduino SPIFFS: Writing a file - techtutorialsx

My dear thank you very much. No kidding.

Then I take a look. I can't read anything anymore, nor time to learn like this. What I manage, and very slowly, is to see something that actually works and read it line by line. To try to understand why it worked.

If you, or someone, don't post how it should be done, I'll understand a lot, but I'll have to wait.

I tried that. Until he reacted. But it had to return httpCode = 200 but it returned = 400 not sending the URL.

char image = SPIFFS.open("/image.jpg", FILE_WRITE);

If you do so, it returns 200 but does not show the image:

unsigned long image = SPIFFS.open("/image.jpg", FILE_WRITE);

Now that I noticed the FILE_WRITE, this is how to write to SPIFFS. By the end of the year I can.

When they came to Brazil and asked where such a place, such a street is,...ah, I want to be close by...

I know I have the option to upload the photo to a website and then attach the URL. But then it stays the same as the first post.

I'm trying to send the photo directly from ESP32.

Maybe it's too complicated.

It's completely unclear what you're trying to do. You'd be wise to reread Post #2 and provide complete information.

Instead of making a POST of a photo using a web address, I intend to attach the stored photo directly from SPIFSS and do the same HTTP POST again.

See my post #1

Is that the colleague UKHeliBob 'gave an order to everyone' by saying that no one would help.

I saw it. Sorry, can't help unless I see enough of the code to put things in context. Good luck.

It's not a case of apologizing, at least not to me, because you don't make any mistakes. Thanks for wishing me luck. I'll need.

To the others who maybe go through this same question, I think I have 2 options: 1) Convert my image that is inside SPIFFS to base64, or 2) Change my mind and send my image to a storage site and get it from there to there to compose the final URL again.

I'll try the 1st option to see if it works.

If you want to help, don't be afraid.

Just to clarify, I have an ESP32 cam, which will take pictures every X seconds.
And I have access to an API that through a composite URL sends pictures. But the photos sent by the API are on an amazon AWS server. So inside the URL you have &image="http://etc etc etc"

That's what I'm trying to change. ESP-CAM will take pictures and temporarily store them in SPIFFS, then I will send the picture and delete it. Wait for new photo, store, send and delete, and repeat this forever.

I'm trying to make the compound URL from the API directly including the picture from SPIFFS.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.