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

quicksketch’s picture

According to my understanding I need to create three filefields to implement this. Is there a better way?

I'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.

quicksketch’s picture

Status: Active » Closed (fixed)