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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:58:24+00:00 2026-06-13T21:58:24+00:00

I am developing using CodeIgniter framework. I have an image upload folder which permission

  • 0

I am developing using CodeIgniter framework.

I have an image upload folder which permission is set to 755. My host is using suPHP so site users are able to upload to it.

I just noticed that when user uploads an image, the IMAGE file permission is 666.

I am naming the images using usernames so it would be quite easy for someone to guess that someone with username ‘hello’ would have an image stored in that directory named ‘hello.jpg’ or ‘hello.png’

Is this unsafe? Could a malicious visitor do something like erase or replace a member’s image from that image upload directory?

Do I have to name the image something random and then store that random image name into that user’s db table row so I know which image name matches which user?

  • 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-13T21:58:25+00:00Added an answer on June 13, 2026 at 9:58 pm

    You should always validate any user input of course, but you could in this case simply check that the current user’s username matches the name being used as the filename (assuming you authenticate the users prior to allowing them to upload), and ensure they have no means to specify the filename via anything they input.

    In short, authenticate, and name your files using known user info’, server-side data only.

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

Sidebar

Related Questions

I am developing web application and using codeIgniter framework. I have one module which
I am developing site using codeigniter.I have a form which contains add button and
I'm developing a web site using codeigniter framework. To document it, I've installed doxygen.
Hello everyone, I'm developing a photo sharing web site using the CodeIgniter PHP framework
I am developing a crowd-funding site (similar to Kickstarter ) using the CodeIgniter framework.
I'm developing a PHP application using CodeIgniter as the framework, and PostgreSQL as the
I have been developing a login library for a website using CodeIgniter. The authentication
I am developing a web book application using the PHP framework CodeIgniter. Users will
I am developing a website using Codeigniter that will have different subdomains for different
I am going to start developing a webapp using php framework codeigniter. The app

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.