From dae1197ce4ddf863da06425d4762129dea4082e1 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Mon, 16 Jul 2018 01:34:48 +0200 Subject: [PATCH] Pass the real file size on bigfile request as the size on the disk can be smaller --- plugins/Bigfile/BigfilePlugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/Bigfile/BigfilePlugin.py b/plugins/Bigfile/BigfilePlugin.py index 29970836..7a01df6f 100644 --- a/plugins/Bigfile/BigfilePlugin.py +++ b/plugins/Bigfile/BigfilePlugin.py @@ -113,7 +113,9 @@ class UiRequestPlugin(object): if kwargs.get("file_size", 0) > 1024 * 1024 and kwargs.get("path_parts"): # Only check files larger than 1MB path_parts = kwargs["path_parts"] site = self.server.site_manager.get(path_parts["address"]) - kwargs["file_obj"] = site.storage.openBigfile(path_parts["inner_path"], prebuffer=2 * 1024 * 1024) + big_file = site.storage.openBigfile(path_parts["inner_path"], prebuffer=2 * 1024 * 1024) + kwargs["file_obj"] = big_file + kwargs["file_size"] = big_file.size return super(UiRequestPlugin, self).actionFile(file_path, *args, **kwargs)