List and preview uploaded files.
This commit is contained in:
parent
8e9ffa2405
commit
79b65dfb34
2 changed files with 94 additions and 1 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue