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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:31:51+00:00 2026-05-15T03:31:51+00:00

Although I realise there are different approaches to securing upload process, I’m still confused

  • 0

Although I realise there are different approaches to securing upload process, I’m still confused when it comes to basic principles. I want to allow users to upload any kind of file they want, but keep my app secure. So my question is:

Is it sufficient to store the files with their original names in ‘uploads’ folder outside ‘webroot’ and fetching them via some download.php script?

If it’t not secure enough, please point me in the right direction, or suggest what additional steps I should take to make it safe.
Thank you.

  • 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-15T03:31:51+00:00Added an answer on May 15, 2026 at 3:31 am

    No, it isn’t enough.

    When you save the uploaded file, you must ensure that nothing malicious happens (e.g. if the file’s “original name” was something like “../somewhere else” it might be possible to overwrite another file, including some PHP script under public_html, which would then allow a cracker to obtain a higher level of access). It’s probably wisest to generate a random name or at least sanitise the original filename before using it.

    In a similar way, download.php must be immune to being ‘tricked’ into retrieving a file that is outside the download directory.

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

Sidebar

Related Questions

Although ASP.NET MVC seems to have all the hype these days, WebForms are still
I realise there have probably been a few questions with a title similar to
In my IRC Bot, there are some commands that I want to only be
Although I'm specifically interested in web application information, I would also be somewhat curious
Although somewhat related to this question , I have what I think is a
Although I don't have an iPhone to test this out, my colleague told me
Although I do understand the serious implications of playing with this function (or at
Although my question might seem abstract I hope it's not. Suppose I develop an
Although I played with it before, I'm finally starting to use Dvorak (Simplified) regularly.
Although I grasp the concept of Bitwise Operators, I can't say that I have

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.