Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Download picture" downloaded file has a wrong .vcf extension (Firefox only) #20143

Open
jancborchardt opened this issue Mar 24, 2020 · 8 comments
Open

Comments

@jancborchardt
Copy link
Member

@jancborchardt jancborchardt commented Mar 24, 2020

To Reproduce
Steps to reproduce the behavior:

  1. Go to any contact
  2. Click on the avatar
  3. Open the 3-dot menu in the top right and click "Download picture"
  4. Open the downloaded file

Expected behavior
The picture is opened.

Actual behavior
Because the file is called Some ID.vcf, it is opened with the text editor and just shows jumbled characters.
Changing the extension to .jpg fixes the issue.

Happens with latest master and happened some weeks before too.

@skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Mar 24, 2020

Peek 24-03-2020 14-48

@jancborchardt
Copy link
Member Author

@jancborchardt jancborchardt commented Mar 24, 2020

Heh, indeed works with Chromium for me as well. Seems to be a Firefox issue as I can reproduce it on my personal instance, the company instance, as well as on local dev env.

@jancborchardt jancborchardt changed the title "Download picture" downloaded file has a wrong .vcf extension "Download picture" downloaded file has a wrong .vcf extension (Firefox only) Mar 24, 2020
@skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Mar 24, 2020

Then it's an issue for server

$response->setHeader('Content-Disposition', 'attachment');

header('Content-Disposition: attachment; filename="'.$_SESSION['name'].'.txt"');

https://stackoverflow.com/questions/9246905/variable-php-download-header-file-name

@skjnldsv skjnldsv transferred this issue from nextcloud/contacts Mar 24, 2020
@jancborchardt
Copy link
Member Author

@jancborchardt jancborchardt commented Apr 2, 2020

@skjnldsv how should we move forward then – transfer the issue to server, loop someone else it, or anything else?

@skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Apr 2, 2020

I guess adding the filename in the Content-Disposition header should work

@deepank120896
Copy link

@deepank120896 deepank120896 commented Apr 8, 2020

@skjnldsv Hi , anyone working on this?

@skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Apr 8, 2020

Nope, go for it @deepank120896 :)
Welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.