We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XMLHttpRequest上传文件demo例子
const formdata = new FormData() formdata.append('file', file) formdata.append('name', filename) formdata.append('other', 'test') const xhr = new XMLHttpRequest() xhr.addEventListener('load', ev => { if (ev.target.status === 200) { // 成功处理 } }, false) // 上传失败 xhr.addEventListener('error', ev => { // 失败处理 }, false) // send xhr.open('POST', url) xhr.setRequestHeader('test', '123') xhr.send(formdata)
The text was updated successfully, but these errors were encountered:
XMLHttpRequest.upload相关事件可以获取上传进度
Sorry, something went wrong.
No branches or pull requests
XMLHttpRequest上传文件demo例子
The text was updated successfully, but these errors were encountered: