I am getting an error while uploading an image to Facebook.
Both image and image path are proper but somehow it is not uploaded to Facebook when I am making a POST
request to {pageid}/photos
API call.
Here is my code.
$photoURL = 'https://www.example.com/images/img.png';
$uploadPhoto = $fb->post('/'.$pageId.'/photos', ['published' => 'false', 'url' => $photoURL]);
And it is giving following error.
Message: (#324) Missing or invalid image file
Please help me.
Thanks.
2
Answers
For me it was the SSl certificate. It was on the server and valid over https, however I had an incorrect intermediate certificate on there. I saw the error when I checked the domain
https://cryptoreport.geotrust.com/checker/views/certCheck.jsp
Thanks
Grant
If you are trying to post from your localhost or virtualhost then error occurs because facebook can not find the url that you are providing.
Try this way:
search image from internet and pass its address to facebook SDK. I will post successfullty.
I was trying to send image from my virtualhost http:app.local.com/image-address and it gave same error. Then I picked an image form internet and passed then it was posted successfully.
Hope it solves your issue