forked from Leerz/bgtoolset
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfile3.php
58 lines (53 loc) · 1.53 KB
/
file3.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
47
48
49
50
51
52
53
54
55
56
57
58
<?php
$file = $_REQUEST['file'];
$files = array(
'FP9TesterK3.swf' => array(
'path' => __DIR__ . '/files/FP9TesterK3.swf',
'type' => 'application/x-shockwave-flash',
'kind' => 'flash',
),
'PS3FP9NC3.swf' => array(
'path' => __DIR__ . '/files/PS3FP9NC3.swf',
'type' => 'application/x-shockwave-flash',
'kind' => 'flash',
),
'PS3LoaderK3.swf' => array(
'path' => __DIR__ . '/files/PS3LoaderK3.swf',
'type' => 'application/x-shockwave-flash',
'kind' => 'flash',
),
'biginteger.pmin.js' => array(
'path' => __DIR__ . '/files/biginteger.pmin.js',
'type' => 'application/x-javascript',
'kind' => 'js',
),
'framework.pmin.js' => array(
'path' => __DIR__ . '/files/framework.pmin.js',
'type' => 'application/x-javascript',
'kind' => 'js',
),
'nofsm_patch_488.bin' => array(
'path' => __DIR__ . '/files/nofsm_patch_488.bin',
'type' => 'application/octet-stream',
'kind' => 'bin',
)
);
$item = $files[$file];
if(!file_exists($item['path'])) {
http_response_code(404);
exit;
}
header('Content-Type: ' . $item['type']);
header('Content-Length: ' . filesize($item['path']));
if($item['kind'] == 'flash') {
header('Content-Transfer-Encoding: binary');
}
if($item['kind'] == 'js') {
header('Content-Description: File Transfer');
header('Content-Disposition: inline; filename="' . $file . '"');
}
if($item['kind'] == 'bin') {
header('Content-Transfer-Encoding: binary');
header('Content-Disposition: attachment; filename="' . $file . '"');
}
readfile($item['path']);