Upload an image from a Bean

Hello
I am downloading an image through an external api, I manage to download the image with cURL and store it in the /upload folder. I have a field type Image and I need that the image that is in the /upload folder, can be seen in the field type Image. I tried to use UploadFile() and also tried to use the class that controls the image fields but nothing works.
Can someone help me or guide me with this problem?

Maybe this will help you