Need "Resume Support" in forced downloding of medi
Posted: Wed Sep 19, 2007 4:34 pm
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I am using the following PHP code to force the internet browser to download a media file(e.g, .mp3, .wma), But in this code, there is no resume support in downloading these files.
i dont know PHP, i am very much thankful to the person who gave me this code.
Kindly tell me, that what changings are to be needed to enable resume support in downloading. I am using linux webserver.
Thankyou.
Code: ( php )Code: Select all
<?php
if((array_key_exists('file', $_GET)) && ($fp = @fopen($_GET['file'], 'rb')) && (pathinfo($_GET['file'], PATHINFO_EXTENSION) != 'php'))
{
header('Content-Disposition: attachment; filename="' . basename($_REQUEST['file']) . '";' );
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($_GET['file']));
fpassthru($fp);
}
else
{
?><html>
<head>
<title>404 - File not found</title>
</head>
<body>
<div style="font-size:36px;">File not found</div>
<div style="font-size:12px;">The file you requested ('<?php echo $_GET['file'] ?>') could not be found.</div>
</body>
</html><?php
}
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
[quote="[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1"][b]1.[/b] Select the correct board for your query. Take some time to read the guidelines in the sticky topic.[/quote]