ดาวน์โหลดไฟล์ ของ php ทำไงหรอคับลองมาหลาบเวปแล้วยังไม่ได้เลยอะคั



    

define('DOCUMENT_FOLDER','docs/');

// add .pdf file extension

$filename=$_GET['iddow'];

$body='<h1>Download file '.$filename.'</h1>';

// get filename to download from DOCUMENTFOLDER or select from database

$file=DOCUMENTFOLDER.$filename;

$body.='<p>Start downloading file <strong>'.$filename.'</strong></p>';

if (fileexists($file) && isfile($file)) {

    header('Content-type: application/pdf');

    header('Content-Disposition: attachment; filename="'.$filename.'"');

    readfile($file);

} else {

    $body.='<p class="error">Download file <strong>'.$filename.'</strong> not found.</p>';

}



ดูให้ที่นะคับ ขอบคุณคับ

18 ม.ค. 2556 1 1,483

http://www.goragod.com/knowledge/....html

อันนี้ได้แน่นอนคับ ผมไปเจอในบทความ เอามาแก้ไขเล็กน้อยแล้วนำมาใช้ดู สรุปว่าใช้ได้คับ
#1
ความคิดเห็น
ไฟล์อัปโหลด ชนิด jpg, jpeg ขนาดไฟล์ไม่เกิน 1024
^