diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 42851b3505..54d749d833 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -148,7 +148,7 @@ $(document).ready(function() { data: data, success: function(token) { if (token) { - showPublicLink(token); + showPublicLink(token, source.substr(source.lastIndexOf('/'))); } } }); @@ -206,7 +206,7 @@ function createDropdown(filename, files) { if (users) { $.each(users, function(index, row) { if (row.uid_shared_with == 'public') { - showPublicLink(row.token); + showPublicLink(row.token, '/'+filename); } else if (isNaN(index)) { addUser(row.uid_shared_with, row.permissions, index.substr(0, index.lastIndexOf('-'))); } else { @@ -237,9 +237,9 @@ function addUser(uid_shared_with, permissions, parentFolder) { $(user).appendTo('#shared_list'); } -function showPublicLink(token) { +function showPublicLink(token, file) { $('#makelink').attr('checked', true); $('#link').data('token', token); - $('#link').val(parent.location.protocol+'//'+location.host+OC.linkTo('files_sharing','get.php')+'?token='+token); + $('#link').val(parent.location.protocol+'//'+location.host+OC.linkTo('files_sharing','get.php')+'?token='+token+'&f='+file); $('#link').show('blind'); }