şu kodu deneyebilirmisiniz

$url = $_POST["link"];

$isim=explode("/",$url);

$isim = $isim[count($isim) - 1];

$konum="resimler/". $isim;
touch($konum);
$al=file_get_contents($url);

for( $i = 0; isset($HTTP_POST_FILES['$isim']['name'][$i]); $i++ ) {

$path = 'resimler/'.$HTTP_POST_FILES['$isim']['name'][$i];
$lastDot = strrpos($path, '.');
$base = substr($file, 0, $lastDot);
$ext = substr($file, $lastDot);
// this loop will keep doing until find a path that no file exists
for( $seq = 0; file_exists($path); $seq++ ) {
if( file_exists($path) ) {
$path = $base . '_'. $seq. $ext;
}
}
$kaydet=file_put_contents($konum,$al);