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

Release downloads should trigger a download #28736

Closed
AsgeirSH opened this issue Jan 8, 2024 · 0 comments · Fixed by #28739
Closed

Release downloads should trigger a download #28736

AsgeirSH opened this issue Jan 8, 2024 · 0 comments · Fixed by #28739
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Milestone

Comments

@AsgeirSH
Copy link

AsgeirSH commented Jan 8, 2024

Description

Overview

When downloading files from a release that contains files that browsers can open (for example a .hex-file), Gitea does not trigger a download.

Instead, the file is opened in a new tab and when manually saving the content, the file type is not preserved and is instead suggested to be saved as .txt.

Expected behavior

When clicking to download a file from a release, Gitea should set the proper headers to ensure that the browser will suggest to save it with the same filename and extension as in the released file.

This works as expected when clicking the Download-button in the Code view.

Example

Reproduced on the demo site: https://try.gitea.io/AsgeirSH/DownloadFileIssueRepro/releases/tag/v0.0.1

Suggested fix

Adding a download attribute in the <a>-tag for the file. When this is added by manually editing the html in Developer tools, it seems to work as expected.

Screenshots

Screenshot 2024-01-08 at 23 49 26
Screenshot 2024-01-08 at 23 52 12

Gitea Version

1.21.3

Can you reproduce the bug on the Gitea demo site?

Yes

Operating System

MacOS and Windows

Browser Version

Chrome Version 120.0.6099.199

@AsgeirSH AsgeirSH added topic/ui Change the appearance of the Gitea UI type/bug labels Jan 8, 2024
@lunny lunny added this to the 1.21.4 milestone Jan 9, 2024
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Jan 9, 2024
lunny pushed a commit that referenced this issue Jan 9, 2024
Backport #28739 by @JakobDev

Fixes #28736

Co-authored-by: JakobDev <jakobdev@gmx.de>
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this issue Jan 17, 2024
silverwind pushed a commit to silverwind/gitea that referenced this issue Feb 20, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants