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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:54:32+00:00 2026-05-28T00:54:32+00:00

It is said in many article about securing file upload that it is better

  • 0

It is said in many article about securing file upload that it is better to prepare a white list of extension instead of a blacklist. But it seems this method has some problem with double extension files. For example I have a whitelist like ‘pdf’,’doc’,’docx’ but this white list return true for apple.php.doc or apple.doc.php .

How can I write a secure extension check function?

  • 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-28T00:54:32+00:00Added an answer on May 28, 2026 at 12:54 am

    you should try to understand the reasons for this, your question doesn’t make any sense.

    the reason you shouldn’t allow any particular extension is that some webservers (like Apache) determine the way the files are server based on them, of course that only applies to files within the directories they’re serving publicly but most of the time the uploaded files go there so what happens when you allow an extension that the server will execute like .php is that it allows random people on the web to inject code on your site.

    that doesn’t happen for .php.doc because the extension is still .doc and the server will treat it like that.

    it’s worth mentioning that one can configure the webserver to not execute certain files within a directory but it’s not the default and few people actually do so.

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

Sidebar

Related Questions

I'm reading about threads and in many books is said that Java support threads
Many articles (e.g. msdn ) have said that a circular reference cannot be cleaned
Many people said that one can achieve higher performance by creating read-only and write-only
In many books is said that the reason for which Java's generic use erasure
I read an article which said: Providing instances for the many standard type-classes [Functors]
Somebody said that when your PHP code and application use global variables then it
They said this expression is valid in C, and that it means calling a
I've heard it said that the Entity Framework is overkill or that it's difficult
Or better said: When to use array as a field data type in a
As Knuth said, We should forget about small efficiencies, say about 97% of the

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.