Beautiful Open-Source Form Builder
fix: file size limit for guest pages (#359)
Favour Olayinkab41d6c0e60b5
diff --git a/client/components/open/forms/OpenFormField.vue b/client/components/open/forms/OpenFormField.vueindex c18f442f4..71b145fba 100644--- a/client/components/open/forms/OpenFormField.vue+++ b/client/components/open/forms/OpenFormField.vue@@ -272,7 +272,11 @@ export default {}} else if (field.type === 'files' || (field.type === 'url' && field.file_upload)) {inputProperties.multiple = (field.multiple !== undefined && field.multiple)- inputProperties.mbLimit = Math.min(Math.max(field.max_file_size, 1), this.form?.max_file_size ?? this.currentWorkspace?.max_file_size)+ let maxFileSize = (this.form?.workspace && this.form?.workspace.max_file_size) ? this.form?.workspace?.max_file_size : 10+ if (field?.max_file_size > 0) {+ maxFileSize = Math.min(field.max_file_size, maxFileSize)+ }+ inputProperties.mbLimit = maxFileSizeinputProperties.accept = (this.form.is_pro && field.allowed_file_types) ? field.allowed_file_types : ''} else if (field.type === 'rating') {inputProperties.numberOfStars = parseInt(field.rating_max_value) ?? 5diff --git a/client/components/open/forms/fields/components/FieldOptions.vue b/client/components/open/forms/fields/components/FieldOptions.vueindex 1916a2869..bae8fc2a9 100644--- a/client/components/open/forms/fields/components/FieldOptions.vue+++ b/client/components/open/forms/fields/components/FieldOptions.vue@@ -343,7 +343,7 @@ export default {return !this.typesWithoutPlaceholder.includes(this.field.type)},mbLimit() {- return this.form?.max_file_size ?? this.currentWorkspace?.max_file_size+ return (this.form?.workspace && this.form?.workspace.max_file_size) ? this.form?.workspace?.max_file_size : 10},prefillSelectsOptions() {if (!['select', 'multi_select'].includes(this.field.type)) return {}