...

View Full Version : PHP Download Image don't appear



autumn
01-26-2012, 06:00 AM
I have been figuring out why the downloaded image will not appear. Here's it:

require_once('include/middletier/waitlist_form.class.php');
$tbleswaitlist = new waitlist_form();
$tbleswaitlist->display_upg($_REQUEST['studentNum']);

$cpath="C:xampp/htdocs/OCWMS/modules/waitlist/uploads/".$tbleswaitlist->name;
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-type: ".$tbleswaitlist->fileType);

header("Content-Disposition: attachment; filename=\"".basename($tbleswaitlist->name)."\"" );
header("Content-Length: ". $tbleswaitlist->fileSize);
ob_clean();
flush();
readfile($cpath);
exit();

Please help me out guyz...

jmj001
01-26-2012, 06:09 AM
print or echo

$tbleswaitlist->name
and see if you are in fact getting the right file and if it exists

or add

if(file_exists($cpath)){
readfile($cpath);
}else{
echo 'oops... no file there';
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum