-
Notifications
You must be signed in to change notification settings - Fork 9
/
fileman-ext.php
executable file
·114 lines (109 loc) · 3.45 KB
/
fileman-ext.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
/*
*
* Filecharger
* by Zarel of Novawave
* PHP extended functions
*
* CORE LIBRARY - DO NOT REMOVE
*
*/
include 'config.inc.php';
include 'fileman.lib.php';
include 'session.lib.php';
$fm_dev = isset($_REQUEST['debug']);
if ($fm_dev)
{
$qsid .= ($qsid?'&':'?').'debug';
$hqsid .= ($hqsid?'&':'?').'debug';
$asid .= '&debug';
$hasid .= '&debug';
$isid .= '<input type="hidden" name="debug" value="1" />';
}
//====================
// And... GO!
//====================
if (isset($_GET['down']))
{
header('Content-Disposition: attachment; filename="'.$file.'"');
readfile($prepath.$presub.$postsub,$file);
die();
}
else if (isset($_GET['upload']))
{
//parent.ext_fclose();
if ($_FILES)
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Upload</title>
<style type="text/css"><!--
@import "fileman.css";
--></style>
</head>
<body style="overflow:hidden;background:#AEC8EC none;">
<div style="padding:5px;">
<?php
foreach($_FILES as $tfile)
{
if ($tfile['name'])
{
$tfilen = basename($tfile['name']);
echo "Uploading '$tfilen'... ";
move_uploaded_file($tfile['tmp_name'],'cache/up/'.$tfilen) or die(':(');
if (fm_upload($tfilen,$d.$tfilen))
echo '<strong style="color:#090;">Successful</strong> ';
else
echo '<strong style="color:#F00;">Failed</strong> ';
}
}
?>
<input type="button" value="Done" onclick="window.location.href='index.php?p=a&d=<?php echo $hd,$hasid; ?>';" /> <input type="button" value="Upload more files" onclick="location.replace('fileman_ext.php?upload&d=<?php echo $hd,$hasid; ?>');" />
</div>
</body>
</html>
<?php
}
else
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Upload</title>
<style type="text/css"><!--
@import "fileman.css";
--></style>
<script language="javascript" type="text/javascript">
<!--
function loading()
{
document.getElementById('l').style.display='block';
document.getElementById('l').innerHTML='<'+'img src="images/throbber-loading.gif" /> <strong>Loading...</strong>';
}
function setmore(a)
{
// do nothing
}
//-->
</script>
</head>
<body style="overflow:hidden;background:#AEC8EC none;">
<div id="l" style="display:none;padding:0 0 100px 0;background:#5A94DE none;vertical-align:center;color:#FFFFFF;font-size:12pt;"></div>
<form id="uploadform" action="fileman_ext.php?upload&d=<?php echo $hd,$hasid; ?>" method="post" enctype="multipart/form-data">
<div style="padding:5px;"><input type="file" name="f1" onblur="if (this.value) document.getElementById('uploadform').submit();loading();" onchange="if (this.value) document.getElementById('uploadform').submit();loading();" /><input type="submit" value="Upload" /> <input type="button" value="Cancel" onclick="window.location.href='index.php?p=a&d=<?php echo $hd,$hasid; ?>';" /></div>
</form>
</body>
</html>
<?
}
}
else
{
echo '<err>?</err>';
}
?>