Open Dayjo opened 7 years ago
So, I've managed to get this to work by getting rid of curl from the base64 decode, and also not using data urls. i.e;
/**
* @param string $path
*
* @return string
*/
public function convertImgtoBased64($path)
{
// $urlParts = pathinfo($path);
// $extension = $urlParts['extension'];
// $ch = curl_init();
// curl_setopt($ch, CURLOPT_URL, $path);
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// curl_setopt($ch, CURLOPT_HEADER, 0);
// $response = curl_exec($ch);
// curl_close($ch);
$response = file_get_contents($path);
$base64 = base64_encode($response);
return $base64;
}
This now works..
Hello, I'm getting the following error response when trying to use this library;
I've tried with multiple files and types (png and jpg) and get the same error.
I'm using the demo code;
Doesn't seem to be anything I can do to get it to work.