Forum: Ruby on Rails Managing large file uploads - best practice?

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.
F3dc06f587d1ff4c7366b102bfda9204?d=identicon&s=25 David Mitchell (Guest)
on 2006-04-12 09:17
(Received via mailing list)
Hello everyone,

I've got an app where I need to give the user the facility to upload a
large-ish (up to maybe 10Mb) CSV file.  I really don't want to have to
deal with idiots uploading porn, /dev/zero, and whatever else they
feel I might appreciate - I want to eliminate everything that isn't a
valid CSV file as quickly as possible in the upload process.
It'll have a reasonably simple login/password mechanism, but it's not
100% clear at this point whether I'll have to have a "guest"-type user
capability, and thus be potentially leaving the front door to the
asylum ajar...

Is there any existing best-practice type information around for how to
police this?  I want to ensure that files being uploaded are valid CSV
files, that they contain a specific number of fields and aren't too
large.

I can think of a few ways of doing it; none strike me as particularly
elegant, particularly when it comes to chopping off any offending file
uploads mid stream.

Thanks in advance for any suggestions

Dave M.
This topic is locked and can not be replied to.