FileServer/views/index.html

50 lines
1.7 KiB
HTML
Raw Normal View History

2025-12-05 04:25:21 +00:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>FileServer</title>
<link rel="stylesheet" href="/assets/bulma.min.css">
<script src="https://kit.fontawesome.com/2effe35473.js" crossorigin="anonymous"></script>
</head>
<body>
<section class="section">
<div class="container">
<h1 class="title">Upload de fichiers</h1>
<p class="subtitle">
Enfin une solution simple que vous gérez vous même
</p>
<form action="/admin/upload" method="post" enctype="multipart/form-data">
<div id="file-js-example" class="file has-name is-boxed">
<label class="file-label">
<input class="file-input" type="file" name="file" />
<span class="file-cta">
<span class="file-icon">
<i class="fas fa-upload"></i>
</span>
<span class="file-label"> Choose a file… </span>
</span>
<span class="file-name"> No file selected </span>
</label>
</div>
<div class="field is-grouped">
<div class="control">
<input type="submit" class="button is-link"/>
</div>
</div>
</form>
</div>
</section>
</body>
<script>
const fileInput = document.querySelector("#file-js-example input[type=file]");
fileInput.onchange = () => {
if (fileInput.files.length > 0) {
const fileName = document.querySelector("#file-js-example .file-name");
fileName.textContent = fileInput.files[0].name;
}
};
</script>
</html>