Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

validate size of upload using Carrierwave

In our latest application we need to process some uploads, I've worked with paperclip before and everything just works! but we're giving carrierwave a try, it looks promising but, I can't find how to validate the size of an attachment, it seems like the documentation doesn't have any information about it, should we add it manually to the model via a custom validator?

Thanks in advance!

like image 587
jpemberthy Avatar asked Jan 20 '11 21:01

jpemberthy


1 Answers

There is a Wiki entry on github: https://github.com/jnicklas/carrierwave/wiki/How-to%3A-Validate-attachment-file-size

like image 181
Flov Avatar answered Sep 28 '22 00:09

Flov