Skip to content

Commit

Permalink
Merge pull request #22922 from owncloud/stable9-share-archivenamedown…
Browse files Browse the repository at this point in the history
…loadall

[stable9] Fix archive file name when downloading public share
  • Loading branch information
DeepDiver1975 committed Mar 9, 2016
2 parents d652c87 + ebfc8b6 commit c2a16e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions apps/files_sharing/js/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,11 @@ OCA.Sharing.PublicApp = {
filename = JSON.stringify(filename);
}
var params = {
path: path,
files: filename
path: path
};
if (filename) {
params.files = filename;
}
return OC.generateUrl('/s/' + token + '/download') + '?' + OC.buildQueryString(params);
};

Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/lib/controllers/sharecontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ public function downloadShare($token, $files = null, $path = '', $downloadStartS
$this->emitAccessShareHook($share);

// download selected files
if (!is_null($files)) {
if (!is_null($files) && $files !== '') {
// FIXME: The exit is required here because otherwise the AppFramework is trying to add headers as well
// after dispatching the request which results in a "Cannot modify header information" notice.
OC_Files::get($originalSharePath, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD');
Expand Down

0 comments on commit c2a16e0

Please sign in to comment.