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?

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

sample 1

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

is there any existing JavaScript code I can search?
0
 
Loganathan NatarajanLAMP DeveloperCommented:
you can also google, "check file extension in javascript before upload"
0
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.