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
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNDAiIGhlaWdodD0iMTQwIiBzdHJva2U9IiMwMDAiPjxwYXRoIHN0cm9rZS13aWR0aD0iMTIyIiBzdHJva2UtZGFzaGFycmF5PSIyLDM4IiBkPSJtOSw3MGgxMjJNNzAsOXYxMjIiLz48cGF0aCBzdHJva2Utd2lkdGg9IjMzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIGQ9Im03MCwzMGgwbTQwLDQwaDBtLTgwLDQwdjBtNDAsMGgwbTQwLDBoMCIvPjwvc3ZnPg==">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>files.gumx.cc / upload</title>
<style>
@font-face { font-family: "Kawkab Mono"; src: url(/fonts/KawkabMono-Regular.woff2); font-weight: normal; }
@font-face { font-family: "Kawkab Mono"; src: url(/fonts/KawkabMono-Bold.woff2); font-weight: bold; }
* { unicode-bidi: plaintext; box-sizing: border-box; }
html { color: black; background-color: white; }
body { font-family: "Kawkab Mono"; font-size: 16px; line-height: 1.4; margin: 0; padding: 4rem 0; min-height: 100%; overflow-wrap: break-word; }
main, header, footer { max-width: 800px; margin-inline: auto; padding: 0 2rem; }
h1, header, footer { text-align: center; }
main { text-align: justify; }
p, h2, h3, h4 { margin: 1em 0 0 0; }
pre { margin: 1em 0; }
pre code { border: thin solid; padding: 1em; display: block; text-align: start; overflow-x: scroll; }
code { font-size: 85%; }
hr { border: none; border-top: thin solid; margin: 1.25rem 0; }
header { margin-bottom: 1em; }
footer { margin-top: 3em; }
input[type="text"], input[type="file"], button { font-family: inherit; font-size: inherit; border: thin solid; padding: 0.3em 0.6em; background: transparent; color: inherit; }
input[type="text"] { width: 100%; }
button { cursor: pointer; }
#result { margin-top: 1em; word-break: break-all; }
@media (max-width: 600px) { body { font-size: 0.9em; } h1 { font-size: 1.8em; } }
@media (prefers-color-scheme: dark) { html { filter: invert(1); } }
</style>
</head>
<body>
<header>
<h1><a href="https://gumx.cc">gumx</a> / <a href="https://files.gumx.cc">files</a> / upload</h1>
</header>
<main>
<p>Upload a file using your token. Files expire after 24 hours by default. Max 256 MB.</p>
<h2>web form</h2>
<p><input type="text" id="token" placeholder="token" autocomplete="off"></p>
<p><input type="file" id="file"></p>
<p><button onclick="upload()">upload</button></p>
<p id="result"></p>
<h2>curl</h2>
<pre><code>curl -F "file=@photo.jpg" -H "Authorization: YOUR_TOKEN" https://files.gumx.cc/</code></pre>
</main>
<footer>
<hr>
<a href="https://twt.gumx.cc">twt</a> /
<a href="https://git.gumx.cc">git</a> /
<a href="https://mail.gumx.cc">mail</a> /
<a href="https://irc.gumx.cc">irc</a> /
<a href="https://files.gumx.cc">files</a> /
<a href="https://vpn.gumx.cc">vpn</a> /
<a href="https://pgp.gumx.cc">pgp</a> /
<a href="https://demo.gumx.cc">demo</a> /
<a href="https://wk.fo">wk.fo</a>
</footer>
<script>
async function upload() {
const token = document.getElementById('token').value.trim();
const file = document.getElementById('file').files[0];
const result = document.getElementById('result');
if (!token) { result.textContent = 'enter a token'; return; }
if (!file) { result.textContent = 'choose a file'; return; }
result.textContent = 'uploading...';
try {
const fd = new FormData();
fd.append('file', file);
const r = await fetch('/', {
method: 'POST',
headers: { 'Authorization': token },
body: fd
});
const text = await r.text();
if (!r.ok) { result.textContent = 'error ' + r.status + ': ' + text; return; }
result.innerHTML = '<a href="' + text.trim() + '">' + text.trim() + '</a>';
} catch (e) {
result.textContent = 'error: ' + e.message;
}
}
</script>
</body>
</html>
|