//Uploads an image for profile picture (still a WIP)
public function UploadPicture($URL)
{
$bytes = file_get_contents($URL);
$request = '--abcdefghijklmnopqrstuvwxyz
Content-Disposition: form-data; name="source"; filename=image.png
Content-Type: image/png
' . $bytes . '
--abcdefghijklmnopqrstuvwxyz--';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, PROFILE_PIC_URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$headers = array(
'Authorization: Bearer ' . $this->oauth,
'Content-Type: multipart/form-data; boundary=abcdefghijklmnopqrstuvwxyz'
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$output = curl_exec($ch);
curl_close($ch);
$data = json_decode($output, false);
return $data;
}
//Uploads an image for profile picture (still a WIP)
public function UploadPicture($URL)
{
$bytes = file_get_contents($URL);
$request = '--abcdefghijklmnopqrstuvwxyz
Content-Disposition: form-data; name="source"; filename=image.png
Content-Type: image/png
' . $bytes . '
--abcdefghijklmnopqrstuvwxyz--';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, PROFILE_PIC_URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$headers = array(
'Authorization: Bearer ' . $this->oauth,
'Content-Type: multipart/form-data; boundary=abcdefghijklmnopqrstuvwxyz'
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$output = curl_exec($ch);
curl_close($ch);
$data = json_decode($output, false);
return $data;
}
Copyright © 2024, NextGenUpdate.
All Rights Reserved.