Can't get files to download from recordset.
Not getting any results.
here is my link
projectuploads/download.php?ProjectID=<?php echo $row_WADAAddProjects['ProUploads']; ?>
My directory for the download page and the file is ../subcontractors/projectuploads/bids.rtf
This is what I get:
download.php?ProjectID=bids.rtf
file:
../subcontractors/projectuploads/bids.rft
Below is the code on the download page. I am not getting any error messages either:
<?php require_once('../../Connections/constructors.php'); ?>
<?php require_once("../../WA_DigitalFilePro/HelperPHP.php"); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_rsproject = "-1";
if (isset($_GET['projectID'])) {
$colname_rsproject = (get_magic_quotes_gpc()) ? $_GET['projectID'] : addslashes($_GET['projectID']);
}
mysql_select_db($database_constructors, $constructors);
$query_rsproject = sprintf("SELECT * FROM AddProjects WHERE projectID = %s", GetSQLValueString($colname_rsproject, "int"));
$rsproject = mysql_query($query_rsproject, $constructors) or die(mysql_error());
$row_rsproject = mysql_fetch_assoc($rsproject);
$totalRows_rsproject = mysql_num_rows($rsproject);?>
<?php
WA_DFP_SetupDownloadStatusStruct("WA_DownloadResult1");
if(($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST)){
WA_DFP_DownloadFile("WA_DownloadResult1", "../projectuploads/", "".$row_rsproject['ProUploads'] ."", "[FileName]", false, false, false, "", "", "", "");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<?php echo $WA_DFP_DownloadStatus["WA_DownloadResult1"]["errorMessage"]; ?>
<?php echo $WA_DFP_DownloadStatus["WA_DownloadResult1"]["fileFullName"]; ?>
</body>
</html>
<?php
mysql_free_result($rsproject);
?>