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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:35:18+00:00 2026-05-26T16:35:18+00:00

I am creating a web site which, among other things, databases pictures. For simplicity

  • 0

I am creating a web site which, among other things, databases pictures. For simplicity lets say that every picture can have a description and a file path, and this is stored in a table, like so

CREATE TABLE IF NOT EXISTS picture
(
  ID INT NOT NULL AUTO_INCREMENT,
  description VARCHAR(150),
  file VARCHAR(150) NOT NULL,
  PRIMARY KEY(ID)
) ENGINE=InnoDB;

Rather than storing all these pictures in a single location and assigning arbitrary file paths, I want the user to be able to upload the pictures via ftp to a unix account and create their own directory hierarchy. This way they can use ftp/sftp/scp to copy them, or ssh and, use other Linux programs, like imagemagik or zip. Or to change permissions for pictures (see below)

Now I realize this will cause problems if the user decides to delete pictures or move them, but I suppose there are ways around this (database does not guarantee pictures will be there, write protect pictures, re-implement mv/rm…)

I have very little databasing experience. I wanted to know if this is advisable. Specifically, whether its good to use Linux file permisions as database permissions. So for example, user Manderly could create group MJ12 and add users WSimons, BPage, and ANavarre to it, then on the website those users would have access to these pictures (not automatically I know, but scripted via PHP) AND they could sftp/ftp/scp them as well.

  • 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-26T16:35:18+00:00Added an answer on May 26, 2026 at 4:35 pm

    After getting answers to other questions from the community, I can now answer my own question.

    It is obviously possible to implement this in PHP by using /etc/passwd, getting file permissions via int fileperms ( string $filename ), and either updating the database with those, or using them as a check before allowing access to files. This however is overkill. It is easier to simply use suPHP.

    suPHP is a tool for executing PHP scripts with the permissions of
    their owners. It consists of an Apache module (mod_suphp) and a setuid
    root binary (suphp) that is called by the Apache module to change the
    uid of the process executing the PHP interpreter.

    As to whether it’s advisable, general consensus at SO seems to be that one should only implement such a server if it serves a purpose. This can be taken to be mean “it’s generally not advisable”

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

Sidebar

Related Questions

I'm creating a multi-tenancy web site which hosts pages for clients. The first segment
I am creating a web site which in which the service providers can create
I have an ASP.NET web site which contains some ImageButton controls that cause postbacks
I am creating an interactive colour sampler for a web site, which has 16
I'm creating a web-site for a company which has browser extensions for Google Chrome,
I am creating a web site for a customer and they want to be
I am looking at creating a web site and I want to try and
I'm write installer for my web site. Installer creating application pool, virtual directory and
I have a web-site based on PHP, to which I would like to add
I'm creating a mobile website that will include a page from which people can

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.