Bravo List
Register
Go Back   > Bravo List > P2P > Forum > Community Cafe
Reply
Thread Tools
  #1  
Old 30th November 2009, 18:23
DML DML is offline
Member
 
Join Date: May 2009
P2P
Posts: 1
Default Download Issue
Hi,

I'm having an issue when downloading torrents and I'm hoping someone here can help.
When clicking to download the .torrent file I get a Not Found error.
The script seems to get the details of the torrent from the database correctly, but then it doesn't seem to follow through.

Source: kDev.org Tork
PHP Version: 5.2

Download.php

PHP Code:
<?

require_once("include/bittorrent.php");

dbconn();

hit_start();

if (!
preg_match(':^/(\d{1,10})/(.+)\.torrent$:'$_SERVER["PATH_INFO"], $matches))
    
httperr();

$id $matches[1];
if (!
$id)
    
httperr();


hit_count();

$res mysql_query("SELECT name FROM torrents WHERE id = $id") or sqlerr(__FILE____LINE__);
$row mysql_fetch_assoc($res);

$fn "$torrent_dir/$id.torrent";

if (!
$row || !is_file($fn) || !is_readable($fn))
    
httperr();


mysql_query("UPDATE torrents SET hits = hits + 1 WHERE id = $id");

require_once 
"include/benc.php";



if (
strlen($CURUSER['passkey']) != 32) {

$CURUSER['passkey'] = md5($CURUSER['username'].get_date_time().$CURUSER['passhash']);

mysql_query("UPDATE users SET passkey='$CURUSER[passkey]' WHERE id=$CURUSER[id]");

}



$dict bdec_file($fn, (1024*1024));

$dict['value']['announce']['value'] = "$BASEURL/announce.php?passkey=$CURUSER[passkey]";

$dict['value']['announce']['string'] = strlen($dict['value']['announce']['value']).":".$dict['value']['announce']['value'];

$dict['value']['announce']['strlen'] = strlen($dict['value']['announce']['string']);



header('Content-Disposition: attachment; filename="'.$torrent['filename'].'"');

header("Content-Type: application/x-bittorrent");



print(
benc($dict)); 

hit_end();

?>
Thank you for your time.

Cheers,
DML
Reply With Quote
  #2  
Old 9th December 2009, 16:31
Phogo's Avatar
Phogo Phogo is offline
VIP
 
Join Date: Jan 2008
United Kingdom
Posts: 902
Default
Check your chmod permissions, also your config file. make sure the downloads directory is correctly set.
Reply With Quote
Reply

Tags
download , issue


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
BBCODE Issue TSSE 5.6 hero34 Template Shares 5 16th February 2010 00:55
Join date & Last seen Issue majio Template Shares 0 17th July 2009 20:07
Database issue murda Torrent Strike 5 17th February 2009 12:57
TSSE 5.1 Issue with the torrentbar Dragan3591 Template Shares 2 5th January 2009 17:21
TS 5.1 Download Slatkis Template Shares 5 8th September 2008 15:53



All times are GMT +2. The time now is 03:13. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.