No, this is not a real Sinatra error :).
This is the personal homepage of Elad Meidar, a web developer and an entrepreneur specializing in Ruby on Rails. I hang around in Israel, and i am currently having the best time of my life over at Fiverr.com
I am a proud member of RailsBridge, Helping new Rails developers get into our world and also contributed a few Patches to the Ruby on Rails core.
Some noob at #rubyonrails (irc.freenode.net) asked a question a few days ago about some issue he had while storing uploaded files as BLOBs in his database.
I Know storing files in a database is usually a bad idea, but i still thought about the face that i was yet to see a propar guidance on how to handle files (using the correct practices of course).
Attachement_fu – The older brother, pretty nice, better than the late file_column.
PaperClip – An “updated” attachement_fu, some people say it’s better than attachement_fu because it is actually working. There is a lot more work being done on this plugin now a days, so it’s better to relay on it rather than on attachment_fu.
Storing your files.
Local File System
This option can only work out for you, if you are running your app on a single server, simply set one of the plugins to store the uploaded files whereever you want, and that’s it.
You can also setup a network folder if you’d like and imitate a local folder across a number of servers, but i’s the same.
What you do need to be careful from, is a situation where you are saving too many files into a single folder, which will cause mainly for a slow file lookup.
Try to refine you directory structures for your upload root in order to avoid such a problem.
The main reasons to use Amazon S3 are that it’s amazingly scalable and incrediably cheap. Other than that it’s pretty easy to manage using the plugins or some gems around there, and it’s generally offloading the weight of sending files to your users an keeping your application servers busy (i wrote before on apache’s x-sendfile header, that’s another way).
and… still.. BLOBs
As i said before, i am not a fan of storing files in your db, seems like out of context for me, but some people like it.
If you insist (and you shouldn’t) , you’ll need to setup a proper migration to handle BLOBs, and the rest is up to you.
You're seeing this error because I think it is funny.