Skip to content

History / How to: Validate attachment file size

Revisions

  • Although the file_size_validator looks very clean, if I'm using a single uploader, maybe something as simple as a custom validator would suffice. This highlights the fact that the file size is actually part of the carrierwave object & can be used for custom validations. Here, I demonstrate a use case where the file size is dynamic depending on the user model.

    @rahuljayaraman rahuljayaraman committed May 25, 2013
  • Clarifying that this checks file size

    @chrisbloom7 chrisbloom7 committed Jun 6, 2011
  • Created How to: Validate attachment file size (markdown)

    @chrisbloom7 chrisbloom7 committed Jun 6, 2011