Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 296561

File size validator should only respect the explicitly configured maximum file size

$
0
0

Problem/Motivation

Drupal\file\Plugin\Field\FieldType\FileItem::getUploadValidators() always sets the maximum file size for uploading based on post_max_size and upload_max_filesize PHP settings.

That prevents us from avoiding max file size validation for some use-cases. A typical use case where this would be helpful is when files are not stored on the same server as Drupal (e.g. they are stored in a remote file system, S3).

Proposed resolution

Let file size validator use max_filesize setting if it is explicitly configured (not empty) only.
Otherwise, we should either skip file_validate_size() completely or do the call and indicate that no file size limit should be enforced.

Remaining tasks

User interface changes

API changes

Data model changes


Viewing all articles
Browse latest Browse all 296561

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>