its not about file duplicate,
// not working code , because i assign $zip_url dynamic
function downloadZipFile($dynamic_url, $filepath){ //echo $dynamic_url;exit; $zip_url = $dynamic_url; $destination_path = $filepath; file_put_contents($destination_path, fopen($zip_url, 'r')); } // working code but here i assign $zip_url static
function downloadZipFile($dynamic_url, $filepath){ //echo $dynamic_url;exit; $zip_url = "http://training.costaclick.net/WAWS_1_9/Catalog/4dd946a8-32e6-43b8-a592-6596a4509ec5-out.zip"; $destination_path = $filepath; file_put_contents($destination_path, fopen($zip_url, 'r')); }
http://www.web-development-blog.com/archives/php-download-file-script/