-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
85 lines (71 loc) · 2.07 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>qHost</title>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.3.0/dropzone.css'>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.9.2/min/dropzone.min.js"
integrity="sha512-VQQXLthlZQO00P+uEu4mJ4G4OAgqTtKG1hri56kQY1DtdLeIqhKUp9W/lllDDu3uN3SnUNawpW7lBda8+dSi7w=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<style>
body {
background: rgb(243, 244, 245);
height: 100%;
color: rgb(100, 108, 127);
line-height: 1.4rem;
font-family: Roboto, "Open Sans", sans-serif;
font-size: 20px;
font-weight: 300;
text-rendering: optimizeLegibility;
}
h1 {
text-align: center;
}
.dropzone {
background: white;
border-radius: 5px;
border: 2px dashed rgb(0, 135, 247);
border-image: none;
max-width: 500px;
margin-left: auto;
margin-right: auto;
}
</style>
</head>
<body>
<h1>qHost File Upload</h1>
<SECTION>
<DIV id="dropzone">
<FORM class="dropzone needsclick" id="sampleFile" action="/upload" method="post">
<DIV class="dz-message needsclick">
Drop files here or click to upload.<BR>
</DIV>
</FORM>
</DIV>
</SECTION>
<br>
<center>
</center>
</body>
</html>
<script>
Dropzone.options.sampleFile = {
maxFilesize: 500000,
init: function () {
this.on("uploadprogress", function (file, progress) {
if (progress == 100) {
console.log(file.name);
var center = document.createElement('center');
var newLink = document.createElement('a');
center.appendChild(newLink);
newLink.appendChild(document.createElement('br'));
newLink.appendChild(document.createTextNode(file.name));
newLink.title = file.name;
newLink.href = `files/${file.name}`;
document.body.appendChild(center);
navigator.clipboard.writeText(newLink.href);
}
});
}
}
</script>