HI,
My files become corrupt as soon as I download them with readfile(),
I notice in my text files that there is an added box in the very beginning so I am guessing the server is messing with the file. I have downloaded via ftp to make sure its not the upload part, and it wasnt its during the download.
Here is my code: The name to the table is changed with “Databasehiddenfrom….”
[code=php]
<?php
//Duckboy81 Custom Duckload_Upload Created By YOURS TRUELEY
//THIS IS THE DOWNLOAD SECTION
if (!eregi(“modules.php”, $PHP_SELF)) {
die (“You can’t access this file directly…”);
}
if (isset($pickup)) {
require_once(“mainfile.php”);
$results = $db->sql_query(“SELECT filename, source, ext, filesize, filetype FROM DATABASEHIDDENFROMYOUREYES WHERE pickup=’$pickup'”);
list($filename, $source, $ext, $size, $type) = mysql_fetch_array($results);
header(“Expires: Mon, 26 Jul 1997 05:00:00 GMT”);
header(“Content-Disposition: attachment; filename=$filename”);
header(“Content-length: $size”);
header(“Content-type: $type”);
readfile(“$source”);
}else{
$error_MSG = “<p><p><br><b>THE FILE YOU REQUESTED COULD NOT BE FOUND.</b></br></p></p>”;
$index = 1;
require_once(“mainfile.php”);
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include(“header.php”);
$pagetitle = “- Duckload Download”;
title(“<img src=’modules/$module_name/duckload_download.gif’ width=’248′ height=’123′ alt=’Duckboy81 Easy Download!’>”);
echo “<center><font class=”content”><b>Welcome To The Download Module For Uploaded Files</b></font></center>$error_MSG”;
}
?>
THANKS FOR ANY ADVICE!!