question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mime type of .docx files is being misidentified as application/zip

See original GitHub issue

When I set up file type restrictions, that included application/vnd.openxmlformats-officedocument.wordprocessingml.document, I was not able to upload a .docx file. After some debugging I figured out that the logic in file-type/index.js seems to be identifying the mime type of docx files as application/zip, which is incorrect.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
arturicommented, Apr 3, 2018

We were thinking of just going back to replying on system extension reporting, but adding extra checks when its incorrect, like with some video files on a Mac. Do you have a suggestion on this?

1reaction
rzinurovcommented, Apr 3, 2018

@arturi thanks for the reply. Are you by any change going to check the file extension instead?

Read more comments on GitHub >

github_iconTop Results From Across the Web

DOCX File type in PHP finfo_file is application/zip
This causes a problem when uploading files to services that enforce matching file extension and MIME type. For example, Mediawiki-based wikis (written using...
Read more >
Uploading MS Word files doesn't work ("File extension does ...
File extension ".doc" does not match the detected MIME type of the file (application/zip). I tried removing "doc" from application/msword in ...
Read more >
Forcing apache to send correct Content-Type for docx files
Problem identified and resolved. The files in question were being downloaded via a custom application which sets its own Content-Type ...
Read more >
Wrong MIME type - Microsoft Community
Both .doc and .dotx files being saved out of Word for Mac have the same MIME type. Template files should be ... MIME...
Read more >
Fix mime type for attachment file uploads. - Jira - Atlassian
CONFSERVER-17718 - Downloading a .docx file in IE7/WinXP gives it a .zip ... PDF attachments with uppercase extension have wrong content type in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found