forked from mirror/oddmu
Be careful when updating your templates because you don't want to overwrite your domain name, admin name and email address in the templates.
48 lines
2.3 KiB
HTML
48 lines
2.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="format-detection" content="telephone=no">
|
|
<meta name="viewport" content="width=device-width">
|
|
<title>Upload File</title>
|
|
<style>
|
|
html { max-width: 70ch; padding: 2ch; margin: auto; color: #111; background-color: #ffe; }
|
|
body { hyphens: auto; }
|
|
form, textarea { width: 100%; }
|
|
label { display: inline-block; width: 20ch }
|
|
.last { max-width: 20% }
|
|
</style>
|
|
</head>
|
|
<body lang="en">
|
|
<h1>Upload File</h1>
|
|
{{if ne .Last ""}}
|
|
<p>Previous upload: <a href="/view/{{.Last}}">{{.Last}}</a></p>
|
|
{{if .Image}}
|
|
<p><img class="last" src="/view/{{.Last}}"></p>
|
|
{{end}}
|
|
{{end}}
|
|
<form action="/drop/{{.Dir}}" method="POST" enctype="multipart/form-data">
|
|
<p>When uploading pictures from a phone, its filename is going to be something cryptic like IMG_1234.JPG.
|
|
Please provide your own filename.
|
|
<p><label for="text">Filename to use:</label>
|
|
<input id="text" name="name" value="{{.Name}}" type="text" placeholder="image.jpg" autofocus required>
|
|
<p>If the uploaded file is a picture from a phone, it is going to be too big for your site.
|
|
Sadly, resizing only works for JPG and PNG files. Luckily, most pictures from a phone camera are JPG images.
|
|
Feel free to specify a max width of 1200 pixels, for example.
|
|
<p><label for="maxwidth">Max width:</label>
|
|
<input id="maxwidth" name="maxwidth" value="{{.MaxWidth}}" type="number" min="10" placeholder="1200">
|
|
<p>If the uploaded file is a JPEG-encoded picture, like most pictures from a phone, you can specify a quality.
|
|
Typically, a quality of 60 is not too bad and a quality of 90 is more than enough.
|
|
<p><label for="quality">Quality:</label>
|
|
<input id="quality" name="quality" value="{{.Quality}}" type="number" min="1" max="99" placeholder="75">
|
|
<p>Finally, pick the file or photo to upload.
|
|
Picture metadata is only removed if the picture gets resized.
|
|
Providing a new max width is recommended for all pictures.
|
|
<p><label for="file">Pick file to upload:</label>
|
|
<input type="file" name="file" required>
|
|
<p><input type="submit" value="Save">
|
|
<a href="/view/index"><button type="button">Cancel</button></a></p>
|
|
</form>
|
|
</body>
|
|
</html>
|