0 && $fp = fopen( $fname, "rb" ) ) { // "rb" for Windows $head = array(); $head[] = "Cache-Control: public"; $head[] = "Pragma: public"; $head[] = "Accept-Ranges: bytes"; // bytes, none $head[] = "Content-Length: $fsize"; if ( $disposition ) { $head[] = "Content-disposition: $disposition; filename=$dl_name"; } $head[] = "Connection: close"; // これをつけると応答コードにKeepAliveのパラメータがなくなる $head[] = "Content-type: $mime; name=$dl_name"; while ( list( $idx, $v ) = each( $head ) ) { header( $v ); } $out_size = 0; while ( !feof( $fp ) ) { $contents = fread( $fp, 8192 ); echo $contents; } fclose( $fp ); } } else { $ret = false; } return $ret; } $phps = array( "dispip", "createqr", "id2md5", "create_password", "src", "rand_order", ); $zips = array( "qrcode", ); $php = @$_REQUEST[ "n" ]; $zip = @$_REQUEST[ "z" ]; if ( in_array( $php, $phps ) ) { $fname = $php.".php"; $mime = "text/plain"; } else { if ( in_array( $zip, $zips ) ) { $fname = $zip.".zip"; $mime = "application/zip"; } else { echo "input fname"; exit; } } lib_download_file( $fname, $fname, $mime ); ?>