im trying to download swf files from the urls, from number 1752 to number 1760. I made a code and everything seem ok but the files are broken! their size are 0 and they are empty! (the swf files) I dont know what is wrong with my code. here's my code:
<?php
$num = 1753;
$files = array('');
while($num !== 1760){
array_push($files, '');
$num++;
}
print_r($files);
$zip = new ZipArchive();
$tmp_file = tempnam('.','');
$zip->open($tmp_file, ZipArchive::CREATE);
foreach($files as $file){
$download_file = file_get_contents($file);
$zip->addFromString(basename($file),$download_file);
}
$zip->close();
header('Content-disposition: attachment; filename=Resumes.zip');
header('Content-type: application/zip');
readfile($tmp_file);
?>
help?