|
<?
header( "Content-Type: application/octet-stream" );
header( "Content-disposition: attachment; filename={$_GET['download_target']}" );
$path = '../download/' . $_GET['download_target'];
$size = filesize( $path );
header( "Content-Length: $size" );
$fp = fopen( $path, 'rb' );
if ( $fp ) {
while( TRUE ) {
if ( feof( $fp ) ) {
break;
}
$ret = fread( $fp, 1024 );
print $ret;
}
fclose( $fp );
}
?>
| |