Skip to content

Conversation

@rullzer
Copy link
Member

@rullzer rullzer commented Oct 10, 2019

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.

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) . '"');
}
Copy link
Member

Choose a reason for hiding this comment

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

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)?

Copy link
Member Author

Choose a reason for hiding this comment

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

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 ;)

Copy link
Member

Choose a reason for hiding this comment

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

maybe at least a pointer to the source file/method where it is used (if there is more info...)?

Before it just used the internalid (timestamp often) which is not really
user friendly.

Signed-off-by: Roeland Jago Douma <[email protected]>
@rullzer rullzer force-pushed the fix/versions/download_filename branch from 9cf0eb0 to c1b8cb2 Compare October 14, 2019 15:56
@rullzer rullzer merged commit 40eb9fa into master Oct 14, 2019
@rullzer rullzer deleted the fix/versions/download_filename branch October 14, 2019 20:27
@rullzer
Copy link
Member Author

rullzer commented Oct 14, 2019

/backport to stable17

@rullzer
Copy link
Member Author

rullzer commented Oct 14, 2019

/backport to stable16

@backportbot-nextcloud
Copy link

backport to stable17 in #17541

@backportbot-nextcloud
Copy link

backport to stable16 in #17542

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants