Skip to content

File upload issue: 500 error or corrupted file. #908

@nikhiltechzillaindiacom

Description

@nikhiltechzillaindiacom

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions