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

The Archive Base Latest Questions

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

I need to provide an unshared upload using php on apache on linux. I

  • 0

I need to provide an unshared upload using php on apache on linux.

I can handle file uploads just fine, and move them to the desired folder. What I wanted to ask was how can I make it so that even if someone knew that folder and the filename, they could never download the file through a browser.

In other words, I need apache to be able to move the file to the folder, but to be unable to serve files from that folder.

Can php write to files outside the docroot? Is there something I can do with htaccess? Or even just linux directory permissions?

I was about to create a blank index.html and give the files a name containing a long random string (to make them unguessable) but decided there must be a better way.

Thanks all.

  • 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-26T02:37:19+00:00Added an answer on May 26, 2026 at 2:37 am

    Upload your files outside the Apache DocumentRoot.

    I.E.

    DocumentRoot /var/www/public/
    

    (where your php files are)

    And upload in /var/www/uploads/

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

Sidebar

Related Questions

Using Spring as Framework, if i need provide business logic's service to either JSP/Servlets(on
I need to provide configuration file, which will describe which STL header files to
I need to provide a utility on a PHP site for a client to
I need to provide a feature such that the user is able to upload
Can someone confirm this: do I need to provide both a CSRF token and
I need to provide a code snippet to my clients that they can add
I'm developing a web application, using ASP.net and C# need to provide a functionality
I need to provide a way of users uploading multiple files (can be 10MB
I need to provide users with the ability to hide/show table columns. Using previous
I need to provide a means for a user to upload photos to their

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.