MCPcopy Index your code
hub / github.com/HelloZeroNet/ZeroNet / actionFile

Method actionFile

plugins/Bigfile/BigfilePlugin.py:126–135  ·  view source on GitHub ↗
(self, file_path, *args, **kwargs)

Source from the content-addressed store, hash-verified

124 return i
125
126 def actionFile(self, file_path, *args, **kwargs):
127 if kwargs.get("file_size", 0) > 1024 * 1024 and kwargs.get("path_parts"): # Only check files larger than 1MB
128 path_parts = kwargs["path_parts"]
129 site = self.server.site_manager.get(path_parts["address"])
130 big_file = site.storage.openBigfile(path_parts["inner_path"], prebuffer=2 * 1024 * 1024)
131 if big_file:
132 kwargs["file_obj"] = big_file
133 kwargs["file_size"] = big_file.size
134
135 return super(UiRequestPlugin, self).actionFile(file_path, *args, **kwargs)
136
137
138@PluginManager.registerTo("UiWebsocket")

Callers 5

actionUiMediaMethod · 0.95
actionUiMediaMethod · 0.95
routeMethod · 0.95
actionUiMediaMethod · 0.95
actionUiMediaMethod · 0.95

Calls 2

openBigfileMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected