-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpamimage.php
38 lines (35 loc) · 996 Bytes
/
pamimage.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
<?php
/*
if(strtoupper($_SERVER['REQUEST_METHOD']) == 'GET'
&& isset($_GET['image']) && isset($_GET['path']))
{ header('Content-type: image/jpeg');
readfile("{$_GET['path']}{$_GET['image']}");
// THIS WILL HAVE THE FOLLOWING VALUE ONCE CALLED:
// readfile("d:/path/to/my/file/myfile.jpg");
exit();
}
*/
/*
header('Content-type: image/jpeg');
echo imagejpeg("/home/kodi/Pictures/scans/Scan20190315060808.jpg");
die;
*/
/*
header('Content-type: image/jpeg');
readfile("/home/kodi/Pictures/scans/Scan20190315060808.jpg");
exit();
*/
/*
header('Content-Type: image/jpg');
//readfile("$_GET['path']" . $_GET['pamimage']);
readfile("/home/kodi/Pictures/scans/Scan20190315060808.jpg");
*/
$filename = 'Scan20190315060808.jpg';
$fileDir = "/home/kodi/Pictures/scans";
$file = $fileDir . $filename;
if (file_exists($file))
{
$b64image = base64_encode(file_get_contents($file));
echo "<img src = 'data:image/jpg;base64,$b64image'>";
}
?>