maulana-y
9/18/2017 - 8:43 AM

Upload Image Base64

public function uploadImageBase64(Request $request)
{
	set_time_limit(0);
	$ad_account_id = $request->get('ad_account_id');
	$image_base64 = $request->get('image_base64');

	$image_base64 = str_replace('data:image/png;base64,', '', $image_base64);
	$image_base64 = str_replace(' ', '+', $image_base64);
	$file = base64_decode($image_base64);

	$response = ManagixAd::uploadImage($ad_account_id, $file);
	return $response;
}