...

View Full Version : file download issue



dizyn
11-14-2007, 07:56 AM
I am having problem with file download, It downloads file but when i try to open it it says file corrupted.

here is my code:

$dir=USER_DOCUMENT_PATH;
if (isset($_REQUEST["action"])) {
$file=$dir.$file;
header("Content-type: application/force-download");
header("Content-Transfer-Encoding: Binary");
header("Content-length: ".filesize($file));
header("Content-disposition: attachment; filename=\"".basename($file)."\"");
readfile("$file");
} else {
echo "No file selected";
}

here is page link:
http://www.ujueta.com/file_download.php?product_id=37&action=download&file_no=2

any idea?

aedrin
11-14-2007, 06:05 PM
This needs more detail, but most questions regarding this have been answered on this page (read the comments): http://php.net/header



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum