Skip to content

Commit

Permalink
Create XHR listeners before opening the connection (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeespitalher authored Mar 19, 2022
1 parent c8097b5 commit d3111c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion s3file/static/s3file/js/s3file.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
file.loaded = 0
return new Promise(function (resolve, reject) {
var xhr = new window.XMLHttpRequest()
xhr.open(method, url)

xhr.onload = function () {
if (xhr.status === 201) {
Expand Down Expand Up @@ -62,6 +61,7 @@
reject(xhr.statusText)
}

xhr.open(method, url)
xhr.send(data)
})
}
Expand Down

0 comments on commit d3111c7

Please sign in to comment.