-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.php
More file actions
55 lines (51 loc) · 2.14 KB
/
Copy pathindex.php
File metadata and controls
55 lines (51 loc) · 2.14 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Phumin Obfuscator</title>
<script src="jqueyr.js"></script>
<script>
$(document).ready(function () {
$('#files').on('change', function (e) {
var files = e.target.files; // FileList
uploadFiles(files);
});
});
function uploadFiles(files) {
// Create a new HTTP requests, Form data item (data we will send to the server) and an empty string for the file paths.
xhr = new XMLHttpRequest();
data = new FormData();
paths = "";
// Set how to handle the response text from the server
xhr.onreadystatechange = function (ev) {
if (xhr.readyState == 4 && xhr.status == 200) {
$("#output").html(xhr.responseText);
}
};
// Loop through the file list
for (var i in files) {
// Append the current file path to the paths variable (delimited by tripple hash signs - ###)
paths += files[i].webkitRelativePath + "###";
// Append current file to our FormData with the index of i
data.append(i, files[i]);
}
// Append the paths variable to our FormData to be sent to the server
// Currently, As far as I know, HTTP requests do not natively carry the path data
// So we must add it to the request manually.
data.append('paths', paths);
// Open and send HHTP requests to upload.php
xhr.open('POST', "compiler.php", true);
xhr.send(this.data);
}
</script>
</head>
<body>
<center>
<center>
<h1>Upload your files & Encode your file</h1>
<span>Upload once folder at time only</span><br><br>
<input type="file" id="files" name="files[]" multiple webkitdirectory />
<pre id="output"></pre>
</center>
</center>
</body>
</html>