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

The Archive Base Latest Questions

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

What would be the best method to implement the following scenario: The web site

  • 0

What would be the best method to implement the following scenario:
The web site calls for a image gallery that has both private and public images to be stored. I’ve heard that you can either store them in a file hierarchy or a database. In a file hierarchy setup how would prevent direct access to the image. In a database setup access to the images would only be possible via the web page view. What would be a effective solution to pursue?

[Edit] Thanks all for the responses. I decided that the database route is the best option for this application since I do not have direct access to the server. Confined to a webroot folder. All the responses were most appreciated.

  • 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-12T08:10:35+00:00Added an answer on May 12, 2026 at 8:10 am

    Having used both methods I’d say go with the database. If you store them on the filestore and they need protecting then you’d have to store them outside the web-root and then use a handler (like John mentions) to retrieve them, anyway. It’s as easy to write a handler to stream them direct from database and you get a few advantages:

    • With database you don’t need to worry about filestore permissions or generating unique filenames or folder hierarchies etc.
    • With database you can easily apply permissions and protection directly – no trying to work out who can view what based on paths etc.
    • With a database you can store the image and metadata all together – when you delete the metadata you delete the image – no possibility of orphaned records where you delete from database but not from filestore
    • Easier to back-up database and images and then restore

    The disadvantage is that of performance, but you can use caching etc. to help with that. You can also use FILESTREAM storeage in SQL Server 2008 (and 05?) which means you get filesystem performance but via the DB:

    “FILESTREAM integrates the SQL Server
    Database Engine with an NTFS file
    system by storing varbinary(max)
    binary large object (BLOB) data as
    files on the file system. Transact-SQL
    statements can insert, update, query,
    search, and back up FILESTREAM data.
    Win32 file system interfaces provide
    streaming access to the data.

    FILESTREAM uses the NT system cache
    for caching file data. This helps
    reduce any effect that FILESTREAM data
    might have on Database Engine
    performance. The SQL Server buffer
    pool is not used; therefore, this
    memory is available for query
    processing.”

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

Sidebar

Related Questions

What would be the best way to detect newline return method in PHP. CR,
Out of curiosity i would like to know how to best implement a class
Best would be if it performs the highlighting exactly as it is in Visual
How best would I exclude results from #other_section, given a structure like this? <form>
What would be best practice to localize your ASP.NET MVC application? I would like
What would be best practice for allowing the user to store data for my
I wanted to know which would be best suitable - EDM or reflection provider
Hey all, what would be best practice for clipping the bottom borders of a
Because ObjectContext.SaveChanges() occurs within a transaction I decided it would be best for my
I am trying to determine which implementation of the data structure would be best

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.