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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:15:49+00:00 2026-06-13T20:15:49+00:00

I have the following: $mimeTypes = array(‘application/msword’); //used to be an array $finfo =

  • 0

I have the following:

$mimeTypes = array('application/msword'); //used to be an array

$finfo = new finfo(FILEINFO_MIME, "/usr/share/misc/magic"); 


$type = $finfo->file($_FILES['userfile']['tmp_name']);
$mime = substr($type, 0, strpos($type, ';'));


    if (in_array($mime, $mimeTypes)) 
      { //let it in

The problem is that I am getting “application/vnd.ms-office” as the filetype for any MSOFFICE file that I attempt to upload. I DO NOT wish to allow all MSOFFICE files, only .DOC’s. Is there a workaround for this?

**Please note that these MSOFFICE type files were created in OPENOFFICE, would this make a difference?

  • 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-13T20:15:50+00:00Added an answer on June 13, 2026 at 8:15 pm

    The best you can do is verify file extension after know the file is a Office document (application/vnd.ms-office) and set manually the correct MIME for current file.

    If you have access to Apache, you can add the correct MIME in conf/mime.types

    application/msword doc
    application/vnd.ms-excel xls
    [..] etc
    

    List of Office MIME Types (from http://filext.com/faq/office_mime_types.php)

    .doc    application/msword
    .dot    application/msword
    .docx   application/vnd.openxmlformats-officedocument.wordprocessingml.document
    .dotx   application/vnd.openxmlformats-officedocument.wordprocessingml.template
    .docm   application/vnd.ms-word.document.macroEnabled.12
    .dotm   application/vnd.ms-word.template.macroEnabled.12
    .xls    application/vnd.ms-excel
    .xlt    application/vnd.ms-excel
    .xla    application/vnd.ms-excel
    .xlsx   application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
    .xltx   application/vnd.openxmlformats-officedocument.spreadsheetml.template
    .xlsm   application/vnd.ms-excel.sheet.macroEnabled.12
    .xltm   application/vnd.ms-excel.template.macroEnabled.12
    .xlam   application/vnd.ms-excel.addin.macroEnabled.12
    .xlsb   application/vnd.ms-excel.sheet.binary.macroEnabled.12
    .ppt    application/vnd.ms-powerpoint
    .pot    application/vnd.ms-powerpoint
    .pps    application/vnd.ms-powerpoint
    .ppa    application/vnd.ms-powerpoint
    .pptx   application/vnd.openxmlformats-officedocument.presentationml.presentation
    .potx   application/vnd.openxmlformats-officedocument.presentationml.template
    .ppsx   application/vnd.openxmlformats-officedocument.presentationml.slideshow
    .ppam   application/vnd.ms-powerpoint.addin.macroEnabled.12
    .pptm   application/vnd.ms-powerpoint.presentation.macroEnabled.12
    .potm   application/vnd.ms-powerpoint.template.macroEnabled.12
    .ppsm   application/vnd.ms-powerpoint.slideshow.macroEnabled.12
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have the following: if (in_array($_FILES['userfile']['type'], $mimeTypes)) { $target_path = ./uploads/{$_SESSION['email']}; $target_path =
I have a silver application that is giving the following error: Error: Unhandler error
I have the following XML document: <MimeType> <Extension>.aab</Extension> <Value>application/x-authorware-</Value> </MimeType> <MimeType> <Extension>.aam</Extension> <Value>application/x-authorware-</Value> </MimeType>
I have the following array: Array ( [0] => Information.pdf [1] => Presentation.pdf [2]
In my Facebook Canvas application i have the following problem: The Facebook application is
I have the following code in my views: def __init__(self, obj='', json_opts={}, mimetype=application/json, *args,
I have following plist: <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd>
I have following source. In insertMessage(..), it calls selectMessage to check whether duplicate record
I have following div in a page (I can not modify). <div id=:0.control>Click me</div>
I have following fiddle: http://jsfiddle.net/BFSH4/ As you see there are two issues: The h1

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.