It takes the picture column from the Excel file and downloads the pictures in each row and the downloaded pictures do not open in the file.
// Resim indirme işlemleri
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $imageUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
$imageData = curl_exec($ch);
curl_close($ch);
// Resimleri img dosyasına kaydetme işlemleri
$imageFile = "img/" . basename($imageUrl);
$file = fopen($imageFile, "wb");
fwrite($file, $imageData);
fclose($file);
// İndirilen resmi direk olarak siteye ekle
$img = "<img src='img/" . basename($imageUrl) . "' alt='Resim'> <br>";
echo $img;
}
}
}
$img = "img/";
$files = scandir($img);
foreach($files as $file) {
if($file !== '.' && $file !== '..') {
echo '<img src="' . $img . $file . '" alt="Resim"><br>';
}
}