{{- /* Directory listing page. Shows directory content and has upload form. */ -}} {{.Title}}

{{.Path}}

{{- /* upload form, visible only if share has write_password */}} {{if .Writable}}
{{- /* dialog that appears if file with such name exists in the directory */}}

{{end}} {{- /* listing element is replaced by id after file upload */}} {{- range .Entries}} {{- if .IsDir}} {{- /*Directory links end with '/', because browser remembers password for directory with trailing slash.*/}} {{- else}} {{- /* download attribute: clicking a file link saves the file instead of opening it in the browser. */}} {{- end}} {{- end}}
Free space: {{.FreeSpace}}
../
{{.Name}}/{{.Name}}{{.Size}} {{.Date}}
{{- /* Upload: for each file asks the server whether the upload would be accepted (OPTIONS with X-Upload-Size), asks before replacing an existing file, uploads with progress, then reloads the file table. The OPTIONS check comes first, because a PUT rejected while the browser is still sending the file ends with a connection reset, and the browser reports only "NetworkError" without reading response error. Error messages are the response bodies. The file is sent as the raw PUT body, the server doesn't need to parse multipart forms. */}} {{if .Writable}} {{end}}