Skip to content
Snippets Groups Projects
Commit f6df71b7 authored by Michael Gapczynski's avatar Michael Gapczynski
Browse files

Set Content-Disposition to attachment for shared private links

parent 9dee2a6b
No related branches found
No related tags found
No related merge requests found
...@@ -68,7 +68,7 @@ if (isset($_GET['token']) && $source = OC_Share::getSource($_GET['token'])) { ...@@ -68,7 +68,7 @@ if (isset($_GET['token']) && $source = OC_Share::getSource($_GET['token'])) {
$mimetype = OC_Filesystem::getMimeType($source); $mimetype = OC_Filesystem::getMimeType($source);
header("Content-Transfer-Encoding: binary"); header("Content-Transfer-Encoding: binary");
OCP\Response::disableCaching(); OCP\Response::disableCaching();
header('Content-Disposition: filename="'.basename($source).'"'); header('Content-Disposition: attachment; filename="'.basename($source).'"');
header("Content-Type: " . $mimetype); header("Content-Type: " . $mimetype);
header("Content-Length: " . OC_Filesystem::filesize($source)); header("Content-Length: " . OC_Filesystem::filesize($source));
//download the file //download the file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment