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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:19:29+00:00 2026-05-26T00:19:29+00:00

I am working on a PHP based website. In the admin there is a

  • 0

I am working on a PHP based website. In the admin there is a section that checks a form field and based on the field looks for a folder on the server. This folder will be in a sub-directory. If it does not exist it needs to be created. After that, previously existing or not, PHP will write file to the folder.

These folders will hold images and PDF files that will be viewed and/or downloaded on the main site.

Here is an example directory structure: merchants/east/user123
In the above merchants and east would definitely exist and user123 may exist or otherwise be created.

Given that info my questions are about folder permissions.

  • What should folders be set to for the best security.
  • Should I open them up wider during operations then chmod them (in PHP) after I’m done to something more secure?
  • What should upper level folders be set to?
  • 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-26T00:19:29+00:00Added an answer on May 26, 2026 at 12:19 am

    770 would be a safe bet for the files. Setting it to that would disallow any public access. I would implement some sort of document delivery system in PHP. PHP will be able to access the non-public files and then send them to the user.

    The upper level folders could be set to the same.

    Update

    As others have said, you can easily chmod them to 600 without any issues. That’s the more secure way of handling it (prevents other users on the system from accessing the files). It also omits “execute”, which isn’t needed for file reading anyway. It’s my personal practice to leave the extras in unless there’s a defined reason not to.

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

Sidebar

Related Questions

I am working on a Drupal-based website that works fine on the remote server
I am working on PHP & mySQL based website. I am trying to setup
I am working on my first PHP based website, and I was wondering what
Hej there, I am currently working on a PHP-based Tool to monitor a rather
I am currently working on integrating a PHP/MySQL-based e-commerce website I manage with the
I am working on a website that passes all PHP scripts through a single
I'm working on an form based website. <select name=foo id=foo> <option value=1>1</option> <option value=2>2</option>
I'm working on a PHP-based webapp that has an existing MySQL database where all
I'm working on a class-based php web app. I have some places where objects
I am working on a personal project based in PHP and MySQL, and I

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.