-
-
Notifications
You must be signed in to change notification settings - Fork 650
Description
When I try to upload file using /_matrix/media/r0/upload url with Content-Type:image/png or image/jpeg, server throws 500 error.
If I make the same request without Content-Type, server return success but when i try to access that file using /_matrix/media/r0/download/{serverName}/{mediaId} url, the file I get in response in corrupted.
Below is the code that i have used to make requets
var headers = { "Content-Type": "image/png", }
let blob = atob(files[0].base64)
axios.post(url, blob, { headers }).then(res => { console.log(res) }) .catch(err => { console.log(err) })
I have tried this with postman with same request parameters it works there
I have compared the request of postman and riot.im, it seems to be the same.
I have no idea why it is failing.
Thank you!