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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:19:30+00:00 2026-05-13T13:19:30+00:00

My file upload routine first checks to make sure the user is logged in

  • 0

My file upload routine first checks to make sure the user is logged in to the wordpress application which is hosting the upload form…CHECK!

Here is the code at the top of my uploader utility that does this…

if (!is_user_logged_in()){
    die("You Must Be Logged In to Access This");;
}

So far so good. Now I’m seeking to further secure the upload utility to prevent malicious scripts from being extracted from the uploaded zip files (the upload requires a zip file).

The downside to using a zip, I presume, is that it can contain any number or type of files that might make it more complicated to handle than otherwise.

So my question is for tips on how to further secure this uploader to make sure no malicious files are sent. The desired allowed files are .php, .jpg, .gif, .png

  • 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-13T13:19:31+00:00Added an answer on May 13, 2026 at 1:19 pm

    Your approach goes the wrong way. You need to make sure that none of the files in the ZIP file are ever going to be used in a situation in which malicious files could do any damage.

    You will never be able to guarantee that an uploaded ZIP file contains only non-malicious data. To do that, you would have to virus scan it, parse the containing PHP code, and whatnot.

    Just see that whatever maliciousness is contained, can never unfold.

    For PHP scripts, for example, you would have to ensure that they are not stored anywhere where they can be called from the outside, and executed.

    For images…. Well, if you want to make totally sure they don’t contain any exploits that attack image displaying components, you could always copy them using PHP´s gd functions, destroying any EXIF Metadata (and probably any other harmful stuff) in the process.

    There is still some basic sanitation one could and should do.
    Check out this question (link below, markdown seems broken right now) for more reading on the issue – especially bobince’s answer and the link he posts. That taught me a lot.

    How to make a safe file upload script in php?

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

Sidebar

Related Questions

I have a file upload form that is being posted back to a servlet
How to make ASP.NET file upload control with resume, without file size limitation and
I have implemented a simple file upload-download mechanism. When a user clicks a file
I have a form that excepts a file upload in ASP.NET. I need to
I have a web application that needs to take a file upload from the
I need to test a web form that takes a file upload. The filesize
My application allows user to upload pdf files and store them on the webserver
I'm writing an import routine that will allow a user to upload a CSV
I have designed a file upload form in PHP where it takes 3 pictures
I have a WCF file upload service, which is using streamed mode. Is it

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.