From 1ced66ecccba529fafd57d9a34a0b90409463cd5 Mon Sep 17 00:00:00 2001 From: Felipe Passos Date: Thu, 17 Mar 2022 16:59:08 -0300 Subject: [PATCH] You should create the listeners before opening the connection https://stackoverflow.com/questions/14160308/xhr-upload-onprogress-doesnt-work --- s3file/static/s3file/js/s3file.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3file/static/s3file/js/s3file.js b/s3file/static/s3file/js/s3file.js index 1c37a26..8e0bf47 100644 --- a/s3file/static/s3file/js/s3file.js +++ b/s3file/static/s3file/js/s3file.js @@ -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) { @@ -62,6 +61,7 @@ reject(xhr.statusText) } + xhr.open(method, url) xhr.send(data) }) }