Working single file upload
This commit is contained in:
@@ -7,6 +7,13 @@
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="../static/style.css">
|
||||
<script src="../static/script.js"></script>
|
||||
<script>
|
||||
function prepUpload() {
|
||||
uploadFiles('submit', 'fileToUpload', 'progressContainer', 'progress', '/upload/photo', {
|
||||
'name': document.getElementById('buttonName').value
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
@@ -15,7 +22,11 @@
|
||||
<div class="alert alert-info text-center" role="alert">
|
||||
Upload a single static photo, single photos are good if you want something that doesn't distract during services.
|
||||
</div>
|
||||
<form method="POST" enctype="multipart/form-data" action="/upload/photo">
|
||||
<form>
|
||||
<div id="progressContainer" class="progress" role="progressbar", aria-label="Upload Progress" aria-valuemin="0"
|
||||
aria-valuemin="0", aria-valuemax="100" >
|
||||
<div id="progress" class="progress-bar" style="width: 0%;">0%</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="fileToUpload">File to Upload</label>
|
||||
<input type="file" class="form-control" name="file" id="fileToUpload" />
|
||||
@@ -24,7 +35,7 @@
|
||||
<label for="buttonName">Button Name</label>
|
||||
<input type="text" class="form-control" name="buttonName" id="buttonName" />
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary form-control">Submit</button>
|
||||
<button id="submit" class="btn btn-primary form-control" onclick="prepUpload()">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user