nirvash/templates/file_upload.html

20 lines
629 B
HTML
Raw Normal View History

2022-06-13 06:32:14 +00:00
{{ $slug := ((.Context).Value "params").Slug }}
{{ $csrfToken := (.Context).Value "csrfToken" }}
{{ template "header" . }}
<h2>File Upload</h2>
<form class="uploader" enctype="multipart/form-data" method="POST" action="/upload-process/{{$slug}}">
<input hidden type="text" name="csrfToken" value="{{$csrfToken}}"/>
<span>Uploading file to /{{$slug}}</span><br/>
<span class="upload-warning">(file with the same name as your upload will be overwritten!)</span><br/>
<label>Select File<br/>
<input required type="file" name="file"/>
</label>
<input type="submit" value="Upload"/>
</form>
{{ template "footer" . }}