-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathuploader.1.php
executable file
·123 lines (116 loc) · 4.38 KB
/
uploader.1.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
115
116
117
118
119
120
121
122
123
<?php
session_start();
$user = $_SESSION['user'];
?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/normalize.css"> <!-- Normalizes cross-browser display differences. --!>
<link rel="stylesheet" href="css/style.css"> <!-- Normalizes cross-browser styling. --!>
<link rel="stylesheet" href="css/defaultTheme.css"> <!-- --!>
<style type="text/css">
.tab {
margin-left: 1cm;
}
</style>
</head>
<BODY class="tab">
<!---------- Main section of User interface ----------!>
<form id="fileupload" class="HTML5Uploader" method="POST" action="uploader/" enctype="multipart/form-data">
<div class="upload-wrapper">
<table><tr>
<!---------- Add file to upload button. ----------!>
<td valign="top">
<div id="select-wrapper" class="info-wrapper">
<div id="browsebutton" class="fileinput-button button gray" href="">
<script type="text/javascript">
console.log("uploader.1.php : display_string = '"+display_string[0]+"'");
console.log("uploader.1.php : currentDir = '<?php echo getcwd(); ?>'");
console.log("uploader.1.php : target_dir = '"+target_dir+"'");
console.log("uploader.1.php : conclusion_script = '"+conclusion_script+"'");
document.write(display_string[0]);
</script>
<input type="file" id="fileinput" name="files[]" class="fileinput" single onchange="Finalize()">
</div>
</div>
</td>
<!---------- Start upload button. ----------!>
<td valign="top">
<div id="info-wrapper-1" class="info-wrapper" style="display: none; font-size: 10px;">
<button id="start-button" class="button greenish" type="submit">Upload</button>
</div>
</td>
<!---------- Upload name and status. ----------!>
<td valign="top">
<div id="info-wrapper-2" class="info-wrapper" style="display: none; font-size: 10px;">
<ul id="files" class="files">
</div>
</td>
<!---------- Time and Speed of upload. ----------!>
<td valign="top">
<div id="info-wrapper-3" class="info-wrapper" style="display: none; font-size: 10px;">
<div title="Remaining time" class="time-info"><span>00:00:00</span></div>
<div title="Uploading speed" class="speed-info">0 KB/s</div>
</div>
</td>
</tr></table>
<!---------- Pass along the script to be run once all files are loaded. ----------!>
<input type="hidden" id="hidden_field" name="target_dir" value="123">
<script type="text/javascript">
document.getElementById('hidden_field').value = target_dir;
Finalize=function() {
// show upload button once input file is selected.
document.getElementById("info-wrapper-1").style.display = 'inline';
}
</script>
</div>
</form>
<!---------- Script section ----------!>
<script id="template-upload" type="text/x-handlebars-template">
{{#each files}}
<li class="file-item">
<div class="first">
<span class="top">
<span class="filename">{{shortenName name}}</span>
</span>
{{#if error}}
<div class="error">
<span>Error: </span>
<span>{{error}}</span>
<span>{{maxFileSize}}</span>
</div>
{{/if}}
</div>
<div class="second">
<span class="filesize">{{formatFileSize size}}</span>
<div class="progress-wrap">
<div class="progress">
<div class="bar" style="width:0%"></div>
</div>
</div>
<div class="clear"></div>
</div>
</li>
{{/each}}
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="js/jquery-1.9.1.min.js"><\/script>')
</script>
<!-- handlebars -->
<script src="js/handlebars.min.js"></script>
<!-- HTML5Uploader -->
<script src="js/jquery.ui.widget.js"></script>
<script src="js/bootstrap-transition.js"></script>
<script src="js/jquery.iframe-transport.js"></script>
<script src="js/jquery.fileupload.js"></script>
<script src="js/jquery.fileupload-process.js"></script>
<script src="js/jquery.fileupload-validate.js"></script>
<script src="js/HTML5Uploader.js"></script>
<script src="js/main.js"></script>
</body>
</html>