element-hq / element-desktop

A glossy Matrix collaboration client for desktop.
https://element.io
GNU Affero General Public License v3.0
1.14k stars 262 forks source link

riot-web desktop app does not offer to download files #727

Open Demi-Marie opened 4 years ago

Demi-Marie commented 4 years ago

Description

If I get a file with an unknown extension, riot-web does not offer to download the file

Steps to reproduce

The file should be downloaded, but it is not.

Logs being sent: no

Version information

For the desktop app:

turt2live commented 4 years ago

Per https://github.com/vector-im/riot-web/issues/12602#issuecomment-595599316 I'm reopening this so we can give it more thought. The download attribute won't work for us because of the Content-Disposition header returning inline.

Demi-Marie commented 4 years ago

This actually works for me @turt2live.

turt2live commented 4 years ago

That might be your media repo then, or possibly some OS setting. This is still very much not working.

Shelvak commented 4 years ago

Same for me, in files like csv or xls. I get a browser tab instead of the download from Riot-desktop. And In the browser tab I can't download/see the file because of a policy error: Refused to load 'about:blank' (MIME type 'text/csv') because it violates the following Content Security Policy Directive: 'plugin-types application/pdf'.

Maybe there's a way to return everything with Content-Type: application/octet-stream directly?

My riot client is running in archlinux:

Edit: this only happens in chrome (v 81) in firefox I get the file downloaded :man_shrugging:

Cheers

532910 commented 4 years ago

image

Clicking on Download just opens it in a new tab / browser.

Element 1.7.5 desktop or web in FF 80.0.1 Debian sid.

Demi-Marie commented 4 years ago

@turt2live @532910 @Shelvak I suspect that the difference is encryption. In an encrypted chat, Element Desktop must download the file itself, since no other program knows how to decrypt it. That’s consistent with the save dialog referencing a blob: URL.

turt2live commented 4 years ago

indeed - this issue is about unencrypted media, though apparently that's never been mentioned.

Shelvak commented 4 years ago

Yeah the encrypted media works like expected. The problem is with the non-encrypted channels/files. I can check now that it still happening in Chrome Versión 85.0.4183.83 && element-web-1.7.4-1 element-desktop-1.7.4-1 (On archlinux)

yennor commented 2 years ago

This still doesn-t seem to work. I've just got send a xlsx. When I try to download it on the Linux Desktop App, just nothing happens. On the android app, it doesn't offer me to download it, only to open it with an other application. But when I do that, the other application can-t find the file as it seems (And I want to download it anyway!) Mimetype would be "mimetype": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"

Penguin-Guru commented 2 years ago

Someone sent me two PDF files (separately). I tried clicking all over the messages and nothing worked. The only thing that had any effect was clicking the download button in the tool bar that appears on hover, and this only responded to input the first time it was clicked per message. The down arrow changed to some other icon for a brief moment and then went back to being a down arrow. I could not see what the intermediary icon was but I assume it was trying to download the file. I searched my home directory exhaustively for the file names but found no matches. No likely files in /tmp either.

I asked the same person to send me an image file. They sent me an image/png. The image displayed inline but clicking the download button had no effect and, again, I could not find the file in any sensible download location.

Element version: 1.9.8 Olm version: 3.2.8 Linux version: 5.10.76 No desktop environment, i3 as window manager.

Hope this helps.