CURL a Photo for Facebook that is not local

So, I am trying to use facebook API to send photos. Everything works for me, but the problem is that because of our server environment (everything is stored on s3) there is no concept of local file paths, so when I have to do this: 'source' => '@'. realpath ($ FILE_PATH) I can not, because all I have is a URL. I know that it does not work with urls. What can I do better? Saving a photo locally and then deleting it after uploading is an option, but it seems like a terrible waste of bandwidth ....

+3
source share
1 answer

A quick look at the curl documentation suggests that you will need to do what you offer. Downloading a file locally, just for downloading, seems like a terrible waste of bandwidth, however in this case it may be necessary. If facebook API does not support URLs in addition to files, I cannot immediately see an alternative.

0
source

Source: https://habr.com/ru/post/1759332/


All Articles