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 152317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:36:05+00:00 2026-05-11T09:36:05+00:00

I have an application that creates records in a table (rocket science, I know).

  • 0

I have an application that creates records in a table (rocket science, I know). Users want to associate files (.doc, .xls, .pdf, etc…) to a single record in the table.

  • Should I store the contents of the file(s) in the database? Wouldn’t this bloat the database?

  • Should I store the file(s) on a file server, and store the path(s) in the database?

What is the best way to do 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-11T09:36:06+00:00Added an answer on May 11, 2026 at 9:36 am

    I think you’ve accurately captured the two most popular approaches to solving this problem. There are pros and cons to each:

    Store the Files in the DB

    Most rbms have support for storing blobs (or binary file data, .doc, .xls, etc.) in a db. So you’re not breaking new ground here.

    Pros

    • Simplifies Backup of the data: you backup the db you have all the files.
    • The linkage between the metadata (the other columns ABOUT the files) and the file itself is solid and built into the db; so its a one stop shop to get data about your files.

    Cons

    • Backups can quickly blossom into a HUGE nightmare as you’re storing all of that binary data with your database. You could alleviate some of the headaches by keeping the files in a separate DB.
    • Without the DB or an interface to the DB, there’s no easy way to get to the file content to modify or update it.
    • In general, its harder to code and coordinate the upload and storage of data to a DB vs. the filesystem.

    Store the Files on the FileSystem

    This approach is pretty simple, you store the files themselves in the filesystem. Your database stores a reference to the file’s location (as well as all of the metadata about the file). One helpful hint here is to standardize your naming schema for the files on disk (don’t use the file that the user gives you, create one on your own and store theirs in the db).

    Pros

    • Keeps your file data cleanly separated from the database.
    • Easy to maintain the files themselves (if you need to change out the file or update it), you do so in the file system itself. You can just as easily do it from the application as well via a new upload.

    Cons

    • If you’re not careful, your database about the files can get out of sync with the files themselves.
    • Security can be an issue (again if you’re careless) depending on where you store the files and whether or not that filesystem is available to the public (via the web I’m assuming here).

    At the end of the day, we chose to go the filesystem route. It was easier to implement quickly, easy on the backup, pretty secure once we locked down any holes and streamed the file out (instead of just serving directly from the filesystem). Its been operational in pretty much the same format for about 6 years in two different government applications.

    J

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

Sidebar

Ask A Question

Stats

  • Questions 91k
  • Answers 91k
  • 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
  • Editorial Team
    Editorial Team added an answer By subclassing DatabaseServerLoginModule I can perform extra checks. ( on… May 11, 2026 at 6:11 pm
  • Editorial Team
    Editorial Team added an answer Are you after the following or do you want to… May 11, 2026 at 6:11 pm
  • Editorial Team
    Editorial Team added an answer You can use this code snippet - __doPostBack('<%= dropdownlist.UniqueID %>',… May 11, 2026 at 6:11 pm

Related Questions

I have two tables, we'll call them Foo and Bar , with a one
I have a project here that connects to an in-production database and grabs tables
Lets say I have a table in a sql server 2000 database called TransactionType:
Background I am working on a legacy small-business automation system (inventory, sales, procurement, etc.)

Trending Tags

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

Top Members

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.