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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:19:15+00:00 2026-06-06T17:19:15+00:00

I have a growing website with around 30k images in 4 sizes for a

  • 0

I have a growing website with around 30k images in 4 sizes for a total of 120k. My current solution is storing them in a DB and from what I’ve read on stack oveflow this seems to be a very bad idea.

I’m starting to see why. I’ve noticed a drastic decrease in performance. think the obvious solution is to move these images to a folder setup and I’d like to use the users ID as a dir name and then have a public and private sub dir.

The structure would look like this:

/54869
    /public
        /size_1/img1.jpg
        /size_2/img1.jpg
        /size_3/img1.jpg
        /size_4/img1.jpg
    /private
        /size_1/img2.jpg
        /size_2/img2.jpg
        /size_3/img2.jpg
        /size_4/img2.jpg

What is the best way to secure this private folder and only provide other users access if the owner of the file has granted permission?

I’d also like to prevent users from simply viewing the contents of any folder but I suppose I could perform a check client side to fix this.

Any thoughts or suggestions?

  • 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-06-06T17:19:17+00:00Added an answer on June 6, 2026 at 5:19 pm

    You could make that folder not accessible from the web (e.g. place the folder outside htdocs or add .htaccess rules).

    Create a PHP script which handles all requests to the private images.
    This script would have to do the following:

    • check if the user is authenticated
    • check if the user is authorized to view the requested image
    • open the image and print it to the browser (you need to set correct http headers to make sure the content is treated as an image)

    Then, in your HTML, simply point to /secret_image.php?id=3 or maybe you want to use the path of the image /secret_image.php?p=/54869/public/size_1/img1.jpg

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

Sidebar

Related Questions

I have a page that have a growing number of images. Just like a
just looking for some advise. I have a website with around 2500 users -
I have downloaded the entire Android SDK from the official website and I installed
I have a growing application with multiple usercontrols, windows, etc that all send a
I have one database whose size is growing very fast. Curruntly its size is
i have been reading this interesting article which is increasing my every growing confusion
A have a database on MS-SQL Server 2008 that is growing a lot, year
I have a master-workers architecture where the number of workers is growing on a
Background: We have web based product and a growing suite of automated Selenium tests
Problem Background: I have a 35K+ user members and growing fast. I am planning

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.