Do not fetch the whole text file for the sidebar preview

Just fetch the first 10kb. This should be more than enough in 99% of the
cases. And avoid downloading a 10mb text file just to display a tiny
portion.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2017-08-01 20:56:53 +02:00
parent bb865a55fe
commit 3aa819c62c
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 6 additions and 1 deletions

View File

@ -35,7 +35,12 @@
},
getFileContent: function (path) {
return $.get(OC.linkToRemoteBase('files' + path));
return $.ajax({
url: OC.linkToRemoteBase('files' + path),
headers: {
'Range': 'bytes=0-10240'
}
});
}
};