Problem/Motivation
Currently, when uploading multiple media items using the bulk upload functionality in Lightning Media, the upload process only respects the global php.ini settings for maximum file size. It does not take into account the file size restrictions configured at the media type level, which are often more restrictive and tailored to specific use cases (e.g., documents vs. images).
Additionally, the allowed file extensions are not being fetched or validated based on the media type. This can lead to confusion for users, unexpected validation failures, or even incorrect file uploads.
Steps to reproduce
Steps to Reproduce
Configure a media type (e.g., "Document") with a max file size of 2MB.
Attempt a bulk upload with a file larger than 2MB.
Notice that the file is accepted unless it exceeds the global PHP limit, ignoring media-specific limits.
Proposed resolution
The module should determine the maximum file size limit based on the selected media type's file field configuration. Specifically:
When a user selects a media type (e.g., Image, Document, Audio, etc.) in the bulk upload form, the system should check the configured maximum upload size for that media type's file field.
The file size value available in the media types should be used to determine the valid file size for bulk upload.
The allowed file extensions should also be dynamically determined based on the media type’s file field settings.
This ensures that both validation and UX are aligned with the actual entity configuration.
This functionality is already available in the Media Bulk Upload module, which dynamically enforces media type-specific file size limits and file extensions during upload.