element-hq / element-hq/element-web

enable_authenticated_media and 3 ways to save media file

Open
#31,576 1 comment 0 reactions 0 assignees View on GitHub
A-File-Download A-Media O-Frequent S-Minor T-Defect
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

0. Enable **enable_authenticated_media** in the synapse config (enabled by default)

1. If you right-click on the image in **Element Desktop** and select "Save image as..", the application tries to save the **jpg** file to a local disk and as a result a window appears with the error "The image failed to save".

Image

Image

At the same time, synapse logs contain an URL request "/_matrix/media/v3/download/otr.ru/iLMjSsUhyMEATImoCaIJTQhv?allow_redirect=true"

---

2. If you right-click on the image in **Element Web** and select "Save image as..", the browser tries to save the **json** file and as a result the error "File wasn't available on site".

![Image](https://github.com/user-attachments/assets/4fc226e3-eadb-485d-8db0-4ef36f120452)

![Image](https://github.com/user-attachments/assets/4181313e-07aa-4cb1-94ea-cbee7f851e79)

synapse logs contain an URL request "/_matrix/media/v3/thumbnail/otr.ru/iLMjSsUhyMEATImoCaIJTQhv?width=800&height=600&method=scale&allow_redirect=true"

---

3. If you click the "**Download**" button in **Element Web/Desktop**, the file is saved without problems.

![Image](https://github.com/user-attachments/assets/12b8df32-1541-4e60-9899-d00f724be6d7)

synapse logs contain an URL request "/_matrix/client/v1/media/download/otr.ru/iLMjSsUhyMEATImoCaIJTQhv?allow_redirect=true"

---

Why are different URLs requested in each of these methods? Can you make all three methods work?

### Outcome

#### What did you expect?
The file is being downloaded

#### What happened instead?
Аn error has occurred

### Operating system

Windows

### Application version

Element 1.12.6

### How did you install the app?

_No response_

### Homeserver

Synapse 1.143

### Will you send logs?

No

Contributor guide

Open the contributing guide

Research direction

No source files or tests are identified in the report. Reproduce the three Element Web/Desktop save paths with enable_authenticated_media enabled, compare the requested media URLs, and trace the client code that constructs them; done means right-click saving works in both clients as well as the existing Download button.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.