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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:54:41+00:00 2026-05-31T09:54:41+00:00

this problem is not really uncommon, but i don’t really have an idea how

  • 0

this problem is not really uncommon, but i don’t really have an idea how can I implement this.
I have 500 registered users in my mini-forum and they have files uploaded in my server.
As my users already mapped my directory structure in my web server, they were able to access the files uploaded of my registered users even they don’t own it.
I use a PHP framework called Yii and MySQL to manage my users, but I want to make my users access their own files only and not the files of others. I’m thinking of using htaccess but that approach is kinda obscure.

If you have any ideas or suggestion please kinda post an answer ^^
thanks

Example:
user “mami” has a folder named “mamifolder”
but user “dadi” must not able to access “mamifolder”. user “dadi” can only access “dadifolder”

Solutions that I know but has major cons:

1) is to store all the files in the database(cons: this is a really bad practice since the days of PHP 4, it’s not really a good practice I think)

2) is to make the uploaded files protected by htaccess and let the php render the uploaded file(cons: another bad practice which makes a web app very slow to load. for example private images will be loaded using php. what if there are many private images will be loaded at the same time in a same page)

  • 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-31T09:54:42+00:00Added an answer on May 31, 2026 at 9:54 am

    I would say your only option is to move the files out of your public web directory and to use something like this. You just need to store the IDs of the files in the database, not the whole file.

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

Sidebar

Related Questions

This is not really a question because I just solved the problem, but I
This questions is not really about code but application design. I have an app
This is not really a programming question, more of an algorithmic one. The problem:
This problem is not readily reproducible in a simple example here but was wondering
i have this problem: ms-access could not delete and i found a potential solution
there's this interesting problem i can not solve myself. I will be very glad,
[Note: There is another thread about this problem but it did not answer the
Ok, So I've googled this problem and I have searched stack overflow but I
i have a very strange problem, well not really a problem because i've fixed
This problem involved me not knowing enough of C++. I am trying to access

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.