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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:21:16+00:00 2026-06-05T20:21:16+00:00

I have a simple site which allows users to upload files (among other things

  • 0

I have a simple site which allows users to upload files (among other things obviously). I am teaching myself php/html as I go along.

Currently the site has the following traits:
–When users register a folder is created in their name.
–All files the user uploads are placed in that folder (with a time stamp added to the name to avoid any issues with duplicates).
–When a file is uploaded information about it is stored in an SQL database.

simple stuff.

So, now my question is what steps do I need to take to:

  • Prevent google from archiving the uploaded files.
  • Prevent users from accessing the uploaded files unless they are logged in.
  • Prevent users from uploading malicious files.

Notes:

I would assume that B, would automatically achieve A. I can restrict users to only uploading files with .doc and .docx extensions. Would this be enough to save against C? I would assume not.

  • 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-05T20:21:18+00:00Added an answer on June 5, 2026 at 8:21 pm

    There is a number of things you want to do, and your question is quite broad.

    • For the Google indexing, you can work with the /robots.txt. You did not specify if you also want to apply ACL (Access Control List) to the files, so that might or might not be enough. Serving the files through a script might work, but you have to be very careful not to use include, require or similar things that might be tricked into executing code. You instead want to open the file, read it and serve it through File operations primitives.

    • Read about “path traversal”. You want to avoid that, both in upload and in download (if you serve the file somehow).

    • The definition of “malicious files” is quite broad. Malicious for who? You could run an antivirus on the uplaod, for instance, if you are worried about your side being used to distribute malwares (you should). If you want to make sure that people can’t harm the server, you have at the very least make sure they can only upload a bunch of filetypes. Checking extensions and mimetype is a beginning, but don’t trust that (you can embed code in png and it’s valid if it’s included via include()).
      Then there is the problem of XSS, if users can upload HTML contents or stuff that gets interpreted as such. Make sure to serve a content-disposition header and a non-html content type.

    That’s a start, but as you said there is much more.

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

Sidebar

Related Questions

If I have a PHP application which allows users to make changes to documents,
I have a fairly simple site which allow users to connect via facebook. I
We have a web app that among other things, allow users to leave a
I have to make a simple site which you can log in and out
Here's the setup. I have web site which is essentially a simple CMS. Here
simple question... Given I have an ASP.NET site, which uses a [custom] RoleProvider, Is
How would I allow a simple PHP site, which already has a user db,
I am making a site which allows users to sign up and record their
My ASP.NET MVC site allows users to register and give themselves user names, which
I have a simple web site ( http://www.kousenit.com/twitterfollowervalue ) that computes a quantity based

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.