init,working
This commit is contained in:
35
www/index.html
Normal file
35
www/index.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user