| Sometimes, you may need to implement download function for access control to avoid illegal connection. Refer below reference code. Header("Content-type: file/unknown");
Header("Content-Disposition: 1; filename="$rfile"");
Header("Content-Description: PHP3 Generated Data");
Header("Pragma: no-cache");
Header("Expires: 0");
$agent = getenv("HTTP_USER_AGENT");
$contents = urldecode($contents);
if(eregi("windows", $agent))
{
$contents = eregi_replace("\r\n","\n", $contents);
}
echo $contents; |