File uploads in Ruby on Rails

When you need to resort to using Flash to handle something, you know you’re in a mess. Yet that is the case when dealing with file uploads. For some inane reason (omg it’s haaarrrrrrrrd) file uploads in browsers are teh SUCK. So it falls to us, web developers, to deal with that shit in a sane manner.

And when I say sane, I really mean holy fuck are you kidding me with this crazytalk? The best solution for file uploads is to use Flash, the most broken of all browser plugins, and patch the fuck around its shortcomings. That’s just sad, people. It makes Jesus cry and all that stuff.
Luckily here is a good post explaining the procedure. Yes, we need to write a custom piece of middleware because Flash is retarded. Yes, also a mimetype plugin because flash is retarded. But it’s worth it, really. I think.
Sigh. Sometimes my work is no fun at all.
Dave Hyatt, please start building an awesome browser-based file uploader. Pretty please?

  1. There is another way. Had same problem with file uploads.
    You can use the apache upload module with some ajax sugar to get a progress bar.
    This should get you started:
    http://railsillustrated.com/screencast-file-uploads-progress-in-rails-passenger.html

    I’ve based my implementation on different version using jQuery instead but it gives you an idea what is possible without flash which does indeed suck ;)

  1. No trackbacks yet.