File upload with database integration

Hello rail users,

I’ve now been surfing the web to see how the trend is in doing file
uploading in rails. So far not much progress. Apart from the form setup,
the methods seem as many as there are people writing about them.
My needs are pretty simple I think, but being new to rails I’m having
some difficulties about how to put them to practise in the best way
inside the rails framework. My preferred method with doing file uploads
is having a special folder where the files go to, maybe some splitting
depending on the mime type. Then having all the files info in the
database, such as mime type, filesize, path, filename etc.
Now this is where I’m at right now. Ok not making it long lets just say
I’ve generated the model and connected it to some other models in my db.
What are your preferred ways in completing this task and first and
foremost my main question concerning almost all my rails questions. How
much code do I have to do, not that I’m unusually lazy just my
experience and problems related to rails so far have been down this
road. I spend some time doing something just to find out 1 day later
that there is a helper for this. To sum up, again how would you
implement these needs the “rails” way and how extensive is the file
uploading support in rails.

Regards,
-Andri Mar Jónsson

Search for “file_column.”

Taylor S. wrote:

Search for “file_column.”

No I think this is not what I’m after since this implies storing the
data as a blob in the database.

Just to make things clear if someone misunderstood. Filedata in
filesystem, fileinfo in database.

Taylor S. wrote:

Search for “file_column.”

Sorry for that last post, read a little better and understand this
better now. Still it seems rather restricted in the sense it’s only
storing the path. Maybe i’ll try and tweak it to include more metadata.

Regards,
-Andri Mar