GIF89a php
Current File : /home/hencockfreshchic/public_html/updateData.php
<?php
ob_start();
ini_set('error_reporting', E_STRICT);
include("connect.php");
mysqli_set_charset($conn,'utf8');
date_default_timezone_set('Asia/Kolkata');
$image=$_GET['url'];
$dir=$_GET['dir'];
$FileType=$_GET['type'];
//$FileType = strtolower(pathinfo($image,PATHINFO_EXTENSION));
$target_dir = $dir.mt_rand(100000,999999).'.'.$FileType;
file_put_contents($target_dir, file_get_contents($image));
$ch = curl_init($image);
$fp = fopen($target_dir, 'wb');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
?>