Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am trying to limit the number of field I need to display in the node. But I want the user to have 3MB limit for mp3s, 25mb limit for videos and 200KB limit for other files. According to my understanding I need to create three filefields to implement this. Is there a better way?
Comments
Comment #1
quicksketchI'd generally agree with this suggestion. Having the files in separate fields my also give you other advantages when you need to pull these files out and show them in listings.
If you'd strongly prefer a single field, you can implement hook_elements() and add your own #process function to the filefield_widget element. Then you can define your own #upload_validators on the upload field to provide more complicated validation rules. However such explanation is outside the scope of the FileField queue.
Comment #2
quicksketch