My website is https://www.mystylequest.com. We provide answers to fashion related questions like "can I find this dress in Yellow?". Answering a question involves submitting a link to a website with the dress, then my website scraps the neccessary images from the submitted link. However, we keep getting this error: file_get_contents(): SSL: Success
upon submitting a valid image link (eg: https://poshmark.com/listing/Blue-and-White-Striped-Palazzo-Pants-5cf5ccaf6a7fbadddcaf2f07).
Here is the code:
if (isset($_POST['SubmitAnswersWithImage'])) {
$image_url = trim($_POST['AnswerImg']);
$url = trim($_POST['AnswerUrl']);
$postId = (int)$_POST['PostId'];
// This is to bypass websites that block our ip
$aContext = array(
'http' => array(
'proxy' => 'tcp://138.68.161.60:8080',
'request_fulluri' => true,
),
);
$cxContext = stream_context_create($aContext);
$image_data = file_get_contents($image_url, false, $cxContext); // Error occurs
$web_url = GoogleStorageManager::uploadBlob('quest_answers', $image_data)->webUrl();
<!-- irrelevant code -->
Any solutions will be greatly appreciated
Thanks in anticipation.