all repos — nirvash @ 6f663500cce5096b097cae74736e003c56b0c4e9

modular CMS using the quartzgun library

templates/file_upload.html (raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{{ $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" . }}