If you are using the old attachment_fu then you can limit with :max_size
param.
For example:
has_attachment :content_type => :image,
:storage => :file_system,
:path_prefix => 'public/files/userfiles',
:max_size => 3.megabytes,
:resize_to => '640x480>',
:thumbnails => { :thumb => '120x120>' }
best regards
eddie
El jueves, 20 de septiembre de 2012 12:29:36 UTC-3, Ignacio Huerta escribió:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi John,
>
> You are probably using paperclip to handle uploads. There are some
> examples in the documentation: https://github.com/thoughtbot/paperclip
>
> As you are probably using an old version of paperclip, the size
> validation syntax has probably changed. Find out what version you are
> using and then I guess it would be easy to find the documentation of
> that version.
>
> I used to use this in Hobo 1.0, maybe it works for you:
>
> validates_attachment_size :photo, :less_than => 2.megabytes
>
> Regards,
> Ignacio
>
>
>
> El 20/09/12 16:30, tomkins escribi�:
> > Thanks for the link. I'm using a very early version of Hobo, 1.0
> > something or 1.1 I think, my problem has probably already been
> > fixed. I'm starting to believe it might be because my app allows
> > people to upload avatars, and the file size is not limited. This
> > could quite easily use far too much memory. How can I limit the
> > file size of an image upload?
> >
> > Thanks for the help John.
> >
> > -- You received this message because you are subscribed to the
> > Google Groups "Hobo Users" group. To view this discussion on the
> > web visit
> > https://groups.google.com/d/msg/hobousers/-/gy7a6L7oBOcJ. To post
> > to this group, send email to [email protected] <javascript:>. To
> > unsubscribe from this group, send email to
> > [email protected] <javascript:>. For more options, visit
> > this group at http://groups.google.com/group/hobousers?hl=en.
>
> - --
> Ignacio Huerta Arteche
> http://www.ihuerta.net
> Tel�fono: 0034 645 70 77 35
> Email realizado con software libre
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
>
> iEYEARECAAYFAlBbNlYACgkQBPlUJ6RHaOQfPQCeOV4wgxNgYuovla254uox/C5B
> Yr0Ani0Pd6nTUEiV1RNgrVxDbXfBNMuI
> =xB+e
> -----END PGP SIGNATURE-----
>
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/hobousers/-/wcIIyRLAT-cJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.