-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
<h1>多文件上传 之 xhr formdata</h1>
<div>
选择文件(可多选):
<input type="file" id="f1" multiple/><br/><br/>
<button type="button" id="btn-submit">上 传</button>
</div> var fileList = document.getElementById('f1').files;
console.log(document.getElementById('title'))
if(!fileList.length){
alert('请选择文件');
return;
}
var fd = new FormData(); //构造FormData对象
fd.append('title', document.getElementById('title').value); 关于 document.getElementById('title') 不存在直接获取是不是有点问题?
Metadata
Metadata
Assignees
Labels
No labels