PHP handle file upload

I am writing the PHP handle upload the file, how can I control the user only upload odt file, I know that using $_FILES["file"["type"] match "application/msword" to control the doc file, but seems no odt file extension control, any alternative way?

Who is Participating?
Loganathan NatarajanConnect With a Mentor LAMP DeveloperCommented:
Just ref these,

sample 1

sample 2
Loganathan NatarajanLAMP DeveloperCommented:
Otherwise, you can validate through javascript before you start upload process.
liyyAuthor Commented:
thanks logudotcom,

is there any existing JavaScript code I can search?
Loganathan NatarajanLAMP DeveloperCommented:
you can also google, "check file extension in javascript before upload"
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.