simple-images-upload/views/pages/upload.ejs

30 lines
845 B
Text

<div class="box">
<form method="POST" enctype="multipart/form-data">
<h1>
Upload
</h1>
<div class="field">
<label for="image">Choisir une image</label>
<input
type="file"
accept="image/*"
class="custom-file-input"
id="image"
name="image"
>
</div>
<button type="submit" class="button is-primary">Uploader</button>
<% if ( page.upload ) { %>
<div class="grid gap-5 grid-cols-1 md:grid-cols-2">
<div class="image-preview">
<img src="<%= page.upload.smallFile %>" alt="Miniature">
</div>
<div>
<%- include('../partials/details', {file: page.upload, index: 0, hideShortUrl: false}) %>
</div>
</div>
<% } %>
</form>
</div>