Skip to content

received pictures can't be displayed/downloaded #21

@DerTeufel

Description

@DerTeufel

I hope you can tell me the correct api to use, to be able to view received images.
Currently i am using:

viewLifecycleOwner.lifecycleScope.launch {
try {
val data = session.fileService().downloadFile(content
)
// Switch to Main thread to update UI
withContext(Dispatchers.Main) {
Glide.with(imageView.context)
.load(data)
.into(imageView)
}
} catch (failure: Throwable) {
Log.e("ImageLoader", "Failed to download image", failure)
}
}

with content being 'MessageWithAttachmentContent'.

On the sender device, the image gets shown properly, because this is found in cache.
On the receiver device, it ends up with this:
`09-25 18:55:17.988 22371 22371 V DefaultFileService: ## FileService downloadFile mxc://matrix.org/MgDMGLWWwdrupnxAaIlSBLbX

09-25 18:55:17.991 22371 22416 V FormattedJsonHttpLogger: --> GET https://matrix-client.matrix.org/_matrix/media/r0/download/matrix.org/MgDMGLWWwdrupnxAaIlSBLbX

09-25 18:55:18.161 22371 22371 V DefaultContentDownloadStateTracker: ## DL Progress Error code:404

09-25 18:55:18.162 22371 22416 V FormattedJsonHttpLogger: <-- 404 Not Found https://matrix-client.matrix.org/_matrix/media/r0/download/matrix.org/MgDMGLWWwdrupnxAaIlSBLbX (169ms, unknown-length body)

09-25 18:55:18.164 22371 22371 E ImageLoader: Failed to download image`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions