Wednesday, November 8, 2017

Save image to my server direct from php file

Copy image to my server direct from URL [duplicate]

1.Use bellow code.
//Get the file
$content = file_get_contents("");
//Store in the filesystem.
$fp = fopen("/location/to/save/image.jpg", "w");
fwrite($fp, $content);
2. 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";

  $image_name1= $date_time2."1001"."1". ".jpg";
C.Save the Image
//Get the file
//$content = file_get_contents($binary1);
//Store in the filesystem.
$fp = fopen($image_path, "w");
fwrite($fp, $binary1);


No comments:

Post a Comment