Recommanded Free YOUTUBE Lecture: <% selectedImage[1] %>

설명

다운로드 버튼을 클릭했을 때, 웹브라우저에서 다운로드 창이뜨도록 하는 POST(:12) 처리방식의 PHP(:12) 코드

코드

<?
    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("\n","\r\n", $contents);
    }
    echo $contents;
?>

변경사항