diff --git a/lib/http-api.js b/lib/http-api.js index 987caafd3..9468d8520 100644 --- a/lib/http-api.js +++ b/lib/http-api.js @@ -205,6 +205,9 @@ module.exports.MatrixHttpApi.prototype = { url += "&filename=" + encodeURIComponent(file.name); xhr.open("POST", url); + if (file.type) { + xhr.setRequestHeader("Content-Type", file.type); + } xhr.send(file); } else { var queryParams = {