最近遇到了这么一个情况,需要同时上传文本和文件到数据库。
我是用springboot + jquery实现的 。
前端代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>文件上传</title>
</head>
<body>
<form id="uploadForm" method="post" enctype="multipart/form-data">
<input type="text" name="info">
<input type="text" name="info">
<input type="file" name="file">
<input type="file" name="file">
</form>
<button id="uploadButton">存入数据库</button>
<script src="js/jquery-3.3.1.min.js"></script>
<script>
$(document).ready(function () {
$("#uploadButton").click(function () {
alert("测试");
var