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:
parent
bb865a55fe
commit
3aa819c62c
|
@ -35,7 +35,12 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
getFileContent: function (path) {
|
getFileContent: function (path) {
|
||||||
return $.get(OC.linkToRemoteBase('files' + path));
|
return $.ajax({
|
||||||
|
url: OC.linkToRemoteBase('files' + path),
|
||||||
|
headers: {
|
||||||
|
'Range': 'bytes=0-10240'
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue