- 添加处理 multipart 表单的 Go 函数 - 创建用于文件上传的 HTML 表单页面 - 支持解析和显示上传文件的元数据- 实现多文件上传处理逻辑 - 添加城市和姓名的文本文件示例- 集成 Bootstrap 样式提升界面美观度
31 lines
1007 B
HTML
31 lines
1007 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"></meta>
|
|
<title>Pro Go</title>
|
|
<link href="bootstrap.min.css" rel="stylesheet"/>
|
|
</head>
|
|
<body>
|
|
<div class="m-1 p-2 bg-primary text-white h2 text-center">
|
|
Upload File
|
|
</div>
|
|
<form method="post" action="/forms/upload" class="p-2" enctype="multipart/form-data">
|
|
<div class="form-group">
|
|
<label class="form-label">Name</label>
|
|
<input type="text" name="name" class="form-control"/>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="form-label">City</label>
|
|
<input type="text" name="city" class="form-control"/>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="form-label">File</label>
|
|
<input type="file" name="files" class="form-control" multiple/>
|
|
</div>
|
|
<div class="form-group">
|
|
<button type="submit" class="btn btn-primary mt-2">Upload</button>
|
|
</div>
|
|
</form>
|
|
</body>
|
|
</html> |