Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 40349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:00:35+00:00 2026-05-10T15:00:35+00:00

I’m going to be starting a project soon that requires support for large-ish binary

  • 0

I’m going to be starting a project soon that requires support for large-ish binary files. I’d like to use Ruby on Rails for the webapp, but I’m concerned with the BLOB support. In my experience with other languages, frameworks, and databases, BLOBs are often overlooked and thus have poor, difficult, and/or buggy functionality.

Does RoR spport BLOBs adequately? Are there any gotchas that creep up once you’re already committed to Rails?

BTW: I want to be using PostgreSQL and/or MySQL as the backend database. Obviously, BLOB support in the underlying database is important. For the moment, I want to avoid focusing on the DB’s BLOB capabilities; I’m more interested in how Rails itself reacts. Ideally, Rails should be hiding the details of the database from me, and so I should be able to switch from one to the other. If this is not the case (ie: there’s some problem with using Rails with a particular DB) then please do mention it.

UPDATE: Also, I’m not just talking about ActiveRecord here. I’ll need to handle binary files on the HTTP side (file upload effectively). That means getting access to the appropriate HTTP headers and streams via Rails. I’ve updated the question title and description to reflect this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:00:36+00:00Added an answer on May 10, 2026 at 3:00 pm

    +1 for attachment_fu

    I use attachment_fu in one of my apps and MUST store files in the DB (for annoying reasons which are outside the scope of this convo).

    The (one?) tricky thing dealing w/BLOB’s I’ve found is that you need a separate code path to send the data to the user — you can’t simply in-line a path on the filesystem like you would if it was a plain-Jane file.

    e.g. if you’re storing avatar information, you can’t simply do:

    <%= image_tag @youruser.avatar.path %> 

    you have to write some wrapper logic and use send_data, e.g. (below is JUST an example w/attachment_fu, in practice you’d need to DRY this up)

    send_data(@youruser.avatar.current_data, :type => @youruser.avatar.content_type, :filename => @youruser.avatar.filename, :disposition => 'inline' ) 

    Unfortunately, as far as I know attachment_fu (I don’t have the latest version) does not do clever wrapping for you — you’ve gotta write it yourself.

    P.S. Seeing your question edit – Attachment_fu handles all that annoying stuff that you mention — about needing to know file paths and all that crap — EXCEPT the one little issue when storing in the DB. Give it a try; it’s the standard for rails apps. IF you insist on re-inventing the wheel, the source code for attachment_fu should document most of the gotchas, too!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 51k
  • Answers 51k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Take a look at John Resig's processing.js. No need to… May 11, 2026 at 6:27 am
  • added an answer It appears that the Lilith log viewer contains an XML-format… May 11, 2026 at 6:27 am
  • added an answer Guess I'm answering this myself. It was really simple. Went… May 11, 2026 at 6:27 am

Top Members

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.