So “C:/Users/…” is a path to a local file on your PC. And Adalo custom action server (which is located somewhere in the cloud) has absolutely no access to your local filesystem.
The example on StackOverflow shows the uploading of an image from local filesystem to a local WP server (see localhost address there). That’s why it works.
I don’t think that Adalo custom actions support Content-Type other than application/json (or maybe text/plain) in their HTTP requests.
And according to the replies in the topic you’re referring to, you need to supply a binary image file. This is also confirmed in this article (Upload Featured Image to Post with WordPress REST API) - the code determines content-type by
Content-Type: ' . wp_get_image_mime( $url )
which means that it determines what is the type of the file in the $url, and after that we see
'body' => file_get_contents( $url )
which means that body is a binary stream of file contents.
Also there is no way to “stream” a binary file to Adalo’s custom action.
Possible workarounds
In my opinion, you will need to use 3rd party platform like Make or Zapier - there you can create the scenario to get image from Adalo and upload it to Wordpress.
Another option could be to find some endpoint / extension to WP REST API, which accepts not only the image itself, but could also upload image using the URL.
Thanks for the thorough reply, I might be stubborn willing to set this up via Adalo, which would have saved met atleast 2 days… I got it fixed with Zapier in like 15 minutes…
Now I need to get it working nice and clean with Adalo so users can make use of it in the future. Hopefully soon i can show u the results of how to make AI blogposts with Chatgpt and Wordpress.