My backend is on Node.js. The image would be saved in a folder created in the project in Node.js. However, this does not happen. I’m having trouble uploading the image correctly. I understand your approach to saving to webroot, but I wanted to handle this via the web service.
I don’t really understand what the job of CakePHP here is.
Why post a form with a image to CakePHP if all its job is just to send it away again with another POST request. Why not send the image directly to your NodeJS app?
Anyway: What you probably need is the resource object behind that UploadedFile object.
So try
As you can see in Http Client - 4.x the HTTP Client requires something of type resource to send as a file because that is what fopen() will return.
And $image->getStream()->detach() will return the underlying resource of your uploaded file since your $image is of type \Laminas\Diactoros\UploadedFile
My frontend is made using cakephp 4. I made a product registration form. In this case, just insert an image in the field and consume an API. The problem is that I can’t send the image to a service made in Node.js