Skip to content

Download files to their original filename - #1676

Merged
lunny merged 1 commit into
go-gitea:masterfrom
silverwind:download-filename
May 5, 2017
Merged

Download files to their original filename#1676
lunny merged 1 commit into
go-gitea:masterfrom
silverwind:download-filename

Conversation

@silverwind

@silverwind silverwind commented May 4, 2017

Copy link
Copy Markdown
Member

This removes the path from download filenames, so dir/file.txt now downloads to file.txt instead of dir-file.txt (browsers replace slashes with dashes).

@lafriks

lafriks commented May 4, 2017

Copy link
Copy Markdown
Member

LGTM

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label May 4, 2017
@sapk

sapk commented May 4, 2017

Copy link
Copy Markdown
Member

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 4, 2017
Comment thread routers/repo/download.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible for little optimization, maybe do path.Base() before String.replace()
It could even be done like name = strings.Replace(path.Base(name), ",", " ", -1)

@lunny lunny added the type/enhancement An improvement of existing functionality label May 5, 2017
@lunny lunny added this to the 1.2.0 milestone May 5, 2017
@silverwind
silverwind force-pushed the download-filename branch from 54ba322 to 2ef6252 Compare May 5, 2017 01:14
@silverwind

Copy link
Copy Markdown
Member Author

@sapk updated, path.Base is applied before the Chrome workaround now. I didn't combine the lines because the path removal isn't part of the workaround.

@lunny
lunny merged commit 935caa7 into go-gitea:master May 5, 2017
@silverwind
silverwind deleted the download-filename branch May 5, 2017 07:24
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants