- $select = "SELECT * FROM `success-stories` where id='$id'";
- $result = $conn->query($select);
- $row = $result->fetch_assoc();
- $file=$row["download_pdf"];
- $file_arr=explode("/",$file);
- $path=$file_arr[0]."/".$file_arr[1]."/".$file_arr[2];
- if(file_exists($path))
- {
- header('Content-Description: File Transfer');
- header('Content-Type: application/pdf');
- header('Content-Disposition: attachment; filename="'.$path.'"');
- header('Expires: 0');
- header('Cache-Control: must-revalidate');
- header('Pragma: public');
- header('Content-Length: ' . filesize($path));
- ob_clean();
- ob_flush();
- readfile($path);
- exit;
- }
- echo "";
Loading

Shiva TiwariPosted Jun 3, 2020, 1:53 AM
Laxmidhar SahooPosted May 30, 2020, 4:10 AM