Well let me ask a question, where do you define your session vars???
now I shall look at your code:
<?
session_start();
if( ! isset($_SESSION['username']))
{
$_SESSION['access_message'] = "Invalid access point. Please check your URL and ensure you are logged in.";
header("location: [url]https://www.myserver.tdl/fileshare/noaccess.php[/url]");
}
$queryObject = $_SERVER["QUERY_STRING"];
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=$queryObject");
readfile($_SESSION['BASE_DIR'].$_SESSION['relativeDir'].$queryObject);
?>
I made one change to the code, try that if it wont work post back and i will look some more