element-hq / element-hq/element-web
enable_authenticated_media and 3 ways to save media file
- 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".
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".


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.

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
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