I've configured TF not to store files in a public place (not public_html/*), and since I can't be arsed opening my FTP client each time a torrent has finished downloading, I've created this little script which allows you to download if right off the HTTPd, without having to use FTP.
Note: PHP is not my native programming language, and this is a very basic script.
- Open dir.php
- After checkUserPath(); add
if ($_GET['download'])
{
if(IsAdmin($cfg["user"]) || preg_match("/^" . $cfg["user"] . "/",$del))
{
$file = $cfg["path"] . $_GET{'download'};
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"".$_GET['download']."\"");
header('Content-Length: ' . filesize($file));
$contents = file_get_contents($file);
echo $contents;
die;
}
else
{
header("Location: index.php");
die;
}
} - Change line 222 to
echo "<tr bgcolor=\"".$bg."\"><td><img src=\"".$image."\" width=\"16\" height=\"16\" alt=\"".$entry."\" border=\"0\"><a href=\"dir.php?download=".urlencode($_GET['dir']."/".$entry)."\" alt=\"\">".$entry."</a></td>"; - Upload
That's it, I think. Tell me if I've missed something or it doesnt work.
Not tested on win32 boxen but I'm sure it'll work fine.