Forum: Ruby on Rails file_column + restrictions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cory W. (Guest)
on 2005-12-26 20:29
Hey All.  Season's Greetings.

Can anyone here elaborate on how one can restrict the size of image
uploads using file_column/rmagick?  I'd like to be able to, in my
controller/model, check the size of an uploaded image, and if it's size
on disk exceeds x amount, I'd like to indicate to the user that this is
a no-go and kill the temp file.

Any ideas?

Thanks a ton.
Cory W.
Kyle M. (Guest)
on 2005-12-26 22:20
(Received via mailing list)
validates_filesize_of :field, :in => 15.kilobytes..1.megabyte

On 12/26/05, Cory W. <removed_email_address@domain.invalid> wrote:
> Thanks a ton.
> Cory W.
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
Kyle M.
Chief Technologist
E Factor Media // FN Interactive
removed_email_address@domain.invalid
1-866-263-3261
This topic is locked and can not be replied to.