Outputting Files
Moderator: General Moderators
Outputting Files
Read Last post
Last edited by Ralle on Sun Oct 30, 2005 4:13 am, edited 1 time in total.
this is my script so far:
it outputs:
Code: Select all
<?
// standard hack prevent
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$id = $_GET['id'];
$result = mysql_query("SELECT * FROM maps WHERE maps_id='$id'");
while ($row = mysql_fetch_array($result))
$filename = 'maps/' . $row['maps_file'];
$file = fopen($filename, 'r');
//set some HTTP headers
Header('Content-Type: application/x-octet-stream');
Header('Content-Transfer-Encoding: binary');
Header('Content-Length: ' . filesize($filename));
Header('Cache-Control: no-cache, must-revalidate'); //HTTP 1.1
Header('Cache-Control: post-check=0, pre-check=0', false); //HTTP 1.1
Header('Pragma: no-cache'); //HTTP 1.0
Header('Content-Description: Whatever the file is');
Header('Content-Disposition: attachment; filename="'.$filename.'"');
Header('Title: ' .$filename());
while(!$feof($file))
print(fread($file, 4096));
fclose($file);
?>Fatal error: Call to undefined function: maps/(6)dragonfire.w3m() in /home/hivework/public_html/forum/downloadmap.php on line 25