Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max fileupload #411

Merged
merged 3 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ Changelog
4.1.7 (unreleased)
------------------

- Nothing changed yet.
- Add filesize upload limit for file and image uploads.
[ThibautBorn]

- Update Dutch translations.
[ThibautBorn]


4.1.6 (2024-03-08)
Expand Down
6 changes: 6 additions & 0 deletions src/collective/easyform/browser/controlpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ class IEasyFormControlPanel(Interface):
default=u",",
)

max_filesize = schema.Int(
title=_(u"Filesize limit"),
description=_(u"Set the maximum filesize (in bytes) that users should be able to upload."),
required=False
)


class EasyFormControlPanelForm(RegistryEditForm):
schema = IEasyFormControlPanel
Expand Down
1 change: 0 additions & 1 deletion src/collective/easyform/browser/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,4 @@ def __call__(self):
)
# and save
self.save(source)
# import pdb; pdb.set_trace()
return self.template()
9 changes: 9 additions & 0 deletions src/collective/easyform/fields.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,13 @@
name="collective.easyform.fields.Likert"
component=".fields.LikertHandler"
/>
<adapter
provides="z3c.form.interfaces.IValidator"
for="collective.easyform.interfaces.IEasyForm
*
*
plone.namedfile.interfaces.INamedField
*"
factory="collective.easyform.validators.FileSizeValidator"
/>
</configure>
Loading
Loading