Paulo Pereira
2008-Jul-30 15:01 UTC
Halt file upload if maximum size is reached. Is that possible?
Hi guys. I''m building a rapidshare-like app, and as such each user has a disk quota. It''s possible to prevent a file save if it exceeds the free space, but I searched for an way to do the same _during_ the file upload. Using flash it''s apparently possible, but I don''t want to use flash. One way to do it is via Apache configuration. But, is there any other way to stop the transfer? I considered attachment_fu, which says in its config: "validates_as_attachment -- This method prevents files outside of the valid range (:min_size to :max_size, or the :size range) from being saved. It does not however, halt the upload of such files. They will be uploaded into memory regardless of size before validation." So, in attachment_fu, this isn''t possible. MAX_FILE_SIZE worked for PHP, but for Rails, apparently it doesn''t. Thanks in advance for any help, Paulo Pereira --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---