From 530c290555cb326e6a6bda867e16931ff4ae7df5 Mon Sep 17 00:00:00 2001 From: Olivier Paroz Date: Thu, 16 Apr 2015 19:46:26 +0200 Subject: [PATCH] Use webDAV to have access to HTTP byte ranges --- apps/files_sharing/js/public.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 = $('').addClass('text-preview'); -- 2.39.5