php download code

add download window in your website when user click on link open download windown and start download

Start php

$file=$_POST['name'];
$downloadpath='put your dir path';

if(file_exists($downloadpath.$file))
{
header('Content-Type:application/sis');
header('Content-Length:'.filesize($download_path.$file));
header('Content-Disposition: attachment;filename='.$file);
$fp=fopen($download_path.$file,'r');
fpassthru($fp);
fclose($fp);
}
else
{
echo 'selected file not available';
}

end php

Popular posts from this blog

Detect location by IP using php code

Text messaging with PHP using the TextMagic API