Pass the real file size on bigfile request as the size on the disk can be smaller
This commit is contained in:
parent
1296ab9b60
commit
dae1197ce4
1 changed files with 3 additions and 1 deletions
|
@ -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
|
if kwargs.get("file_size", 0) > 1024 * 1024 and kwargs.get("path_parts"): # Only check files larger than 1MB
|
||||||
path_parts = kwargs["path_parts"]
|
path_parts = kwargs["path_parts"]
|
||||||
site = self.server.site_manager.get(path_parts["address"])
|
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)
|
return super(UiRequestPlugin, self).actionFile(file_path, *args, **kwargs)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue