내 문제는 다운로드 아이콘을 클릭하여 파일 (확장자)을 다운로드하는 것입니다. Print 문으로 시도했지만 새 창이 열리고 사용자가 표시됩니다 전체 웹 페이지를 인쇄 할 수 있지만 쿼리에서 하나의 파일을 다운로드하도록 지정해야합니다. 어떤 아이디어?웹 페이지에있는 mysql 결과에서 파일을 다운로드하십시오.
이 그것을 할 수 있어야 이미지에 사용자 클릭이
doc_id passport_no photo nic_copy passport_copy
200004 N8899999 1376630109.jpg 1376630110.jpg 1376630111.jpg
을 다운로드 할 때 내 쿼리가 표시되는 방법이며,이 제는
<?php if (isset($_GET['file'])) {
$file = $_GET['file'];
if (file_exists($file) && is_readable($file) && preg_match('/\.pdf$/',$file)) {
header('Content-Type: application/pdf');
header("Content-Disposition: attachment; filename=\"$file\"");
readfile($file);
}
} else {
header("HTTP/1.0 404 Not Found");
echo "<h1>Error 404: File Not Found: <br /><em>$file</em></h1>";
}
?>
.. 다운로드 링크
코딩한다<a href="http://localhost/visa/view.php?file=example.pdf">Click here to download PDF</a>
이가 내 문제를 해결 도움이 당신이 –