how can save an image file into byte array. i post the image file to server as base64. and tehn convert to jpg. but i dont know how can convert to bytearray from JPG
$base=$_POST["image"];
$binary=base64_decode($base);
$file = fopen("image.jpg", "w");
fwrite($file, $binary);
fclose($file);