diff options
author | Olivier Paroz <github@oparoz.com> | 2015-04-16 19:46:26 +0200 |
---|---|---|
committer | Olivier Paroz <github@oparoz.com> | 2015-04-23 18:19:17 +0200 |
commit | 530c290555cb326e6a6bda867e16931ff4ae7df5 (patch) | |
tree | c2674b06b481ecf5823adc21f9d64d3f8536a6bc /apps/files_sharing/js | |
parent | e113d67430c0433e96c0de83e989bd6284fd0d63 (diff) | |
download | nextcloud-server-530c290555cb326e6a6bda867e16931ff4ae7df5.tar.gz nextcloud-server-530c290555cb326e6a6bda867e16931ff4ae7df5.zip |
Use webDAV to have access to HTTP byte ranges
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r-- | apps/files_sharing/js/public.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index cfb6569529f..f80d5e15de9 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -111,8 +111,11 @@ OCA.Sharing.PublicApp = { img.attr('src', $('#downloadURL').val()); img.appendTo('#imgframe'); } else if (mimetype.substr(0, mimetype.indexOf('/')) === 'text') { + // Undocumented Url to public WebDAV endpoint + var url = parent.location.protocol + '//' + + token + '@' + location.host + OC.linkTo('', 'public.php/webdav'); $.ajax({ - url: $('#downloadURL').val(), + url: url, headers: {Range: "bytes=0-1000"} }).then(function (data) { var textDiv = $('<span/>').addClass('text-preview'); |