Skip to content

feat(SFT-1175): Added max_files, max_filesize:kb and max_filesize:mb for File Upload fields #186

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

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ public function getMaxFileSizeKB()
return $this->maxFileSizeKB ?: self::DEFAULT_MAX_FILESIZE_KB;
}

/**
* @return int
*/
public function getMaxFileSizeMB()
{
return $this->getMaxFileSizeKB() / 1024;
}

/**
* @return int
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ public function transformField(
$prefix . 'layout' => $this->getTableLayout($field),
$prefix . 'use_script' => $field instanceof TableField ? $field->isUseScript() : null,
$prefix . 'max_rows' => $field instanceof TableField ? $field->getMaxRows() : null,
$prefix . 'max_files' => $field instanceof FileUploadField ? $field->getFileCount() : null,
$prefix . 'max_filesize:kb' => $field instanceof FileUploadField ? $field->getMaxFileSizeKB() : null,
$prefix . 'max_filesize:mb' => $field instanceof FileUploadField ? $field->getMaxFileSizeMB() : null,
];

if (null !== $columnCount && null !== $columnIndex) {
Expand Down