Wednesday, November 8, 2017

Send image from Android Application and Save image to my server direct from php file

 Send image from Android Application use bellow code 
a.Get picture from android
$OutLet_Picture = $_REQUEST['OutLet_Picture'];
b.Check Image isEmpty
$image_name1 = "none";

if(!empty($OutLet_Picture)){
  @$base64Data1=$_REQUEST['OutLet_Picture'];
  @$binary1=base64_decode($base64Data1);
  $image_name1= $date_time2."1001"."1". ".jpg";
C.Save the Image
//Get the file
$image_path='/var/www/example.com/public_html/New_Images/'.$image_name1;
//$content = file_get_contents($binary1);
//Store in the filesystem.
$fp = fopen($image_path, "w");
fwrite($fp, $binary1);
fclose($fp); 



}

No comments:

Post a Comment