PHP to get the breakpoint renewal code of the file
/ / / / / / / / / / / / / / / / / / / / / / / / / > if (! Is_file ($file)) {die (.Quot; 404 File not found!.quot;); Strrchr ($filename,.Quot;..quot;), 1)); / / / / obtain a file extension
/ / / / / / / / > switch ($file_extension) {
case.Quot. Ot; I am really wrong /zip.quot; break;
case.Quot; mp3.quot; $ctype=.quot; audio/mpeg.quot; break;
case; Is it really wrong, /force-download.quot;;
}
//Begin writing headers
header (.Quot; Cache-Control:.quot;);
> / > / > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > header. Strstr ($_SERVER.#91;'HTTP_USER_AGENT'.#93;.Quot; MSIE.quot;)) / / / / / / if IE browser
workaround for IE filename bug. $iefilename = preg_replace ('/. /' / ','. ', $filename, substr_count ($filename,'. ') - 1);
header (.Quot; Content-Disposition: attachment; filename=.quot; $iefilename.quot;}) T;);
}
header (.Quot; Accept-Ranges: bytes.quot;);
$size=filesize ($file);
/ / / > = > > / > / / > To request one or more sub ranges of an entity. For example, representing the first 500 bytes: bytes=0-499 represents second 500 bytes: bytes=500-999 represents the last 500 bytes: bytes=-500 represents the range after 500 bytes: bytes=500- first and last byte: bytes=0-0, -1 at the same time a few scopes: bytes =500-600601-999 But the server can ignore the request header, and if the unconditional GET contains the Range request header, the response will be returned with the state code 206 (PartialContent) instead of 200 (OK).
---------------------------*/
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / Ot; -.quot; $range); / / what does this sentence do?
$size2=$size-1; / / / / file total byte number
$new_length=$size2-$range; / / / / obtain the next download length
header (.Quot; HTTP/1.1 206 Partial Content.quot;);
header. $range$size2/$size.quot;); when //Content-Range: bytes 4908618-4988927/4988928 95%,
} else / / / / / / / / / / > $size2=$size-1;
header (.Quot; Content-Range:); Ength:.Quot;.$size); / / / / output general
}
/ / / / / / > $fp=fopen (.Quot; $file.quot;.Quot; rb.quot;);
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / settings Ime_limit (0);
Print (FREAD ($fp, 1024*8)); / / / output file
flush (); / / / output buffer
ob_flush ();
}
; / / /