-
Notifications
You must be signed in to change notification settings - Fork 5
/
temp2.php
46 lines (40 loc) · 1.42 KB
/
temp2.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
include "config.php";
// for opening pdf in browser
$sql = "SELECT * from mimetry where id=13";
$res = mysqli_query($con, $sql);
$row = mysqli_fetch_assoc($res);
echo "<script>console.log({$row['file']})</script>";
// // print_r($row);
// header("Content-Type: application/pdf");
// header('Content-Disposition: inline; filename="Hello.pdf"');
// // header('Content-Transfer-Encoding: binary');
// header('Accept-Ranges: bytes');
// echo $row['file'];
// header('Content-type: application/pdf');
// header('Content-Disposition: inline; filename=name.pdf');
// header('Content-Transfer-Encoding: binary');
// header('Accept-Ranges: bytes');
// @readfile("data:application/pdf;base64,{$row['file']}");
header('Pragma: public');
header('Expires: 0');
header('Content-Type: application/pdf');
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename=hi.pdf');
header('Content-Transfer-Encoding: binary');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Content-Length' . filesize($row['file']));
ob_clean();
flush();
readfile($row['file']);
?>
<?php
//for downloading pdf
// header('Content-Description: File Transfer');
// header('Content-Type: application/octet-stream');
// header('Content-Disposition: attachment; filename= Hello.pdf');
// header('Expires: 0');
// header('Cache-Control: must-revalidate');
// header('Pragma: public');
// readfile('BillUploads/Hello.pdf');
?>