You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
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.
can someone explain me this api?
POST /_matrix/media/r0/upload?filename=War+and+Peace.pdf HTTP/1.1 Content-Type: application/json "<bytes>"
what does "<bytes>" means in this api and how can i get a file in this format in javascript ?
Thank you!
The text was updated successfully, but these errors were encountered:
When I try to upload file using
/_matrix/media/r0/upload
url withContent-Type:image/png
orimage/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.
can someone explain me this api?
POST /_matrix/media/r0/upload?filename=War+and+Peace.pdf HTTP/1.1
Content-Type: application/json
"<bytes>"
what does
"<bytes>"
means in this api and how can i get a file in this format in javascript ?Thank you!
The text was updated successfully, but these errors were encountered: