0

I would like upload .docx, but

In $_FILES['field']['type'] is application/vnd.openxmlformats-officedocument.wordprocessingml.document, but in mime_content_type() return application/zip

Why these types are diffrent? Which is good?

1 Answer 1

1

The DOCX format consists of a number of different files all wrapped up in a zip file. The software you are using is examining the file, seeing it is a zip file and reporting it with the standard MIME type for zip.

"Good" is somewhat subjecting, but application/vnd.openxmlformats-officedocument.wordprocessingml.document is probably better as it is more specific.

Sign up to request clarification or add additional context in comments.

1 Comment

The same is with .rar files, $_FILES return 'application/octet-stream' and php function return 'application/x-rar'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.