mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 00:48:04 +08:00
feat: support plugin max package size
This commit is contained in:
@ -84,6 +84,11 @@ class PluginUploadFromPkgApi(Resource):
|
||||
tenant_id = user.current_tenant_id
|
||||
|
||||
file = request.files["pkg"]
|
||||
|
||||
# check file size
|
||||
if file.content_length > dify_config.PLUGIN_MAX_PACKAGE_SIZE:
|
||||
raise ValueError("File size exceeds the maximum allowed size")
|
||||
|
||||
content = file.read()
|
||||
response = PluginService.upload_pkg(tenant_id, content)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user