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

  • SEARCH
  • Home
  • 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 397643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:40:14+00:00 2026-05-12T16:40:14+00:00

Possible Duplicate: storing uploaded photos and documents – filesystem vs database blob I am

  • 0

Possible Duplicate:
storing uploaded photos and documents – filesystem vs database blob

I am starting to develop a web app, the primary purpose of which is to display photos. The users will be able to upload photos as well.

The first question that came up was where to store the photos: on the file system or the database.

I will be using a Windows box to host the site. The database is MySQL and the backend code is in C# utilizing ASP.NET MVC.

  • 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. Editorial Team
    Editorial Team
    2026-05-12T16:40:14+00:00Added an answer on May 12, 2026 at 4:40 pm

    Filesystem, of course, unless you’re aiming for a story on thedailywtf. The easiest way is to have the photos organized by a property you can derive from the file itself, such as its SHA-1 hash. Then just store the hash in the database, attached to the photo’s primary key and other attributes (who uploaded it, upload date, etc).

    It’s also a good idea to divvy up the photos on the filesystem, so you don’t end up with millions of files in a single directory. So you’ll have something like this:

    storage/00/e4/f56c0de1c61fdb926e79e8a0a65bd12930c9.jpg
    storage/25/9a/ec1c55bfb660548a6770238668c4b117d92f.jpg
    storage/5d/d5/4b01d98f17a9ad9dd1526b49ba39b5aa37a1.jpg
    storage/63/49/6f740b6c284ce6685dc17d473a7360ace249.jpg
    storage/b1/75/066d178188dde110149a8422ab651b0ee615.jpg
    storage/b1/20/a2b7d02b7b0c43530677ab06235382a37e20.jpg
    storage/da/39/a3ee5e6b4b0d3255bfef95601890afd80709.jpg
    

    This is also easy to port if you ever move to sharded storage.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You need to add the 'lib' directory to your path… May 12, 2026 at 7:03 pm
  • Editorial Team
    Editorial Team added an answer In your callback $(this) won't refer to your element any… May 12, 2026 at 7:03 pm
  • Editorial Team
    Editorial Team added an answer typeof(System.Windows.Visibility) May 12, 2026 at 7:03 pm

Related Questions

Possible Duplicate: Storing Images in DB - Yea or Nay? For ages I've been
Possible Duplicate: Storing echoed strings in a variable in PHP Suppose I have <?php
Possible Duplicate: Which collection for storing unique strings? I am currently using a Dictionary<string,
Possible Duplicate: Maximum length of the textual representation of an IPv6 address? What would
Possible Duplicate: Ways around putting a password in code If you create an application

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.