[email protected] wrote:
Thanks for the response Chovy.
Firstly there is a file uploaded and secondly to check that the file
does not contain zero bites.
I would like to keep everything in the model if possible.
It depends a little on how you are performing the uploads. If you are
using attachment_fu, as I do, you can set the size range within the
has_attachment call through the :size parameter, ex :size =>
10…1000.bytes. You can also insert a custom validation expression
within one of the validate methods, ex.
errors.add_to_base(“Invalid file size”) unless
At least these are a couple of ways to do it.