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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:42:05+00:00 2026-06-16T00:42:05+00:00

I’m making a site in which people will be able to upload files to

  • 0

I’m making a site in which people will be able to upload files to a specific subdirectory. Just in case someone were able to bypass the filters for uploading potentially malicious (presumably php) files, I wondering if it is possible to make the malicious code inaccessible. I am looking at 2 different methods.

The first is to see if there was a way with to make it so you cannot access any files in the subdirectory by typing the files url into the browser (www.example.com/images/blahblah.jpg), but have the files still appear properly when linked to by <img src=images/blahblah.jpg />

The second way to accomplish this could be to disable php in the subdirectory with the .htaccess file. I’ve tried php_admin_flag engine off,

php_flag engine off,

RemoveHandler .php
RemoveType .php
php_flag engine off
Options -ExecCGI

but each try either does nothing, or disables everything in the directory. Is there a reason these are not working? What is the best way to disable php or secure a directory with .htaccess?

  • 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-16T00:42:06+00:00Added an answer on June 16, 2026 at 12:42 am

    You can keep the metadata about the uploaded files in a Db and store the content rather in a custom extension text file. For example everything uploaded could be stored as 1.ext or file.my or no extension at all. And when the file is requested you will just read and dump its content. Adding to this will be to rename all files uploaded.

    You can also keep the original files out of the document root( and its subdirectory ) and with the help of .htaccess have all request forwarded to a single file lets call entrance.php Then that php file will simply read the file and dump its content or issue a 404 if not found or not the type allowed.

    Hope it helps.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a French site that I want to parse, but am running into
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have an autohotkey script which looks up a word in a bilingual dictionary
I have an array which has BIG numbers and small numbers in it. I
I have a text area in my form which accepts all possible characters from

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.