Skip to content

demo4:bug: #2

@wangdabaoqq

Description

@wangdabaoqq
<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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions