-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathupload-form.ejs
41 lines (38 loc) · 1.5 KB
/
upload-form.ejs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
<title>ZIP File Upload and Download</title>
</head>
<body>
<h1>ZIP File Upload and Download</h1>
<h2>Upload a ZIP File</h2>
<form action="/upload" method="post" enctype="multipart/form-data">
<label for="name">Package Name:</label>
<input type="text" name="name" id="name" required><br>
<label for="description">Package Description:</label>
<input type="text" name="description" id="description" required><br>
<input type="file" name="file" accept=".zip" required>
<input type="submit" value="Upload">
</form>
<h2>Uploaded Files</h2>
<ul>
<% uploadedFiles.forEach(file => { %>
<li><a href="/download?package=<%= file %>"><%= file %></a></li>
<% }); %>
</ul>
<h2>Update Package</h2>
<form action="/update" method="post">
<label for="name">Package Name:</label>
<input type="text" name="name" id="name" required><br>
<label for="description">Package Description:</label>
<input type="text" name="description" id="description" required><br>
<input type="hidden" name="packageId" id="packageId" value="packageIdToUpdate">
<input type="submit" value="Update">
</form>
<form action="/package/byRegEx" method = "get">
<label for="name">Package Name:</label>
<input type="text" name="name" id="name" required><br>
<input type="submit" value="Search">
</form>
</body>
</html>