Set the proper filename for version downloads#17503
Merged
Conversation
ChristophWurst
approved these changes
Oct 10, 2019
blizzz
reviewed
Oct 14, 2019
Comment on lines
+70
to
+80
| if ($this->request->isUserAgent( | ||
| [ | ||
| Request::USER_AGENT_IE, | ||
| Request::USER_AGENT_ANDROID_MOBILE_CHROME, | ||
| Request::USER_AGENT_FREEBOX, | ||
| ])) { | ||
| $response->addHeader('Content-Disposition', 'attachment; filename="' . rawurlencode($filename) . '"'); | ||
| } else { | ||
| $response->addHeader('Content-Disposition', 'attachment; filename*=UTF-8\'\'' . rawurlencode($filename) | ||
| . '; filename="' . rawurlencode($filename) . '"'); | ||
| } |
Member
There was a problem hiding this comment.
Do we do that magic for those user agents somewhere else as well? Or phrased differently: is there a piece of doc for the reasoning (in the source)?
Member
Author
There was a problem hiding this comment.
Yes we use it in another DAV plugin as well.
However as I want this backported to at least 17 I would like to have it as clean as possible ;)
Member
There was a problem hiding this comment.
maybe at least a pointer to the source file/method where it is used (if there is more info...)?
icewind1991
approved these changes
Oct 14, 2019
Before it just used the internalid (timestamp often) which is not really user friendly. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
9cf0eb0 to
c1b8cb2
Compare
Member
Author
|
/backport to stable17 |
Member
Author
|
/backport to stable16 |
|
backport to stable17 in #17541 |
|
backport to stable16 in #17542 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before it just used the internalid (timestamp often) which is not really
user friendly.
This means that if the file is download the user has to manually rename it. Which is well. Not really user friendly.