I am currently developing a local plugin which pulls some data from a given URL and adds that to a Strapi Content-Type. Currently, one of the pieces of data that my local plugin pulls is the URL of an image and stores that in my Content-Type.
I noticed that the Strapi Upload plugin has an “Upload from URL” functionality and having tried it by copying and pasting the image URL from the entry created by my local plugin, that functionality is exactly what I need.
However, I would like to know if I can send the URL I recieve from my local plugin directly to the Strapi Upload plugin after which the image which that URL points to will be added to the media library and I can add that to my Content-Type entry instead of the image URL? I noticed in the documentation it is described that I could upload files using the /upload endpoint, however it is expecting a file. Simply put, is there a way I could send an image URL to the /upload endpoint and have that image added to the media library?
I have looked through the controllers for the built-in Strapi uploader, and while I can see the action for the upload of a file itself, I can't seem to find the function which fetches that image when a URL is supplied.
For more context you can view my plugin code here: github
I hope I have explained well enough. Thank you for any help.