List and preview uploaded files.

This commit is contained in:
CronyAkatsuki 2023-12-21 11:15:27 +01:00
parent 8e9ffa2405
commit 79b65dfb34
2 changed files with 94 additions and 1 deletions

View file

@ -11,6 +11,21 @@
<body>
<h1>File List</h1>
{{range .Files}}
<hr />
<div class="file">
{{if eq .FileType "image"}}
<img src="/files/{{.Name}}" alt="{{.Name}}" />
{{else if eq .FileType "video"}}
<video controls src="/files/{{.Name}}" />
{{else if eq .FileType "text"}}
<pre>{{.Content}}</pre>
{{end}}
<div class="info">
<a href="/files/{{.Name}}" download>{{.Name}}</a>
</div>
</div>
{{end}}
</body>
</html>