35 lines
922 B
HTML
35 lines
922 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset='utf-8'>
|
|
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
|
|
<title>FileShare</title>
|
|
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
|
<link rel='stylesheet' type='text/css' media='screen' href='main.css'>
|
|
</head>
|
|
|
|
<body>
|
|
<br>
|
|
<br>
|
|
<h1>FileShare</h1>
|
|
<br>
|
|
<br>
|
|
<form action="/upload" method="POST" enctype="multipart/form-data">
|
|
<label for="upload" id="upload_btn">Select file</label>
|
|
<input type="file" name="upload" id="upload">
|
|
<label for="submit">Upload</label>
|
|
<input type="submit" id="submit">
|
|
</form>
|
|
</body>
|
|
</html>
|
|
<script defer>
|
|
const btn = document.getElementById("upload_btn");
|
|
|
|
document.getElementById("upload").onchange = (e) => {
|
|
let filename = e.target.value;
|
|
const last = filename.lastIndexOf('\\');
|
|
filename = filename.substring(last+1);
|
|
btn.innerText = filename;
|
|
}
|
|
</script> |