This tutorial shows how to allow only specific file types to be uploaded to the server. In this example I have shown how to allow only Microsoft word document and pdf file types. You can add more file types here.
We need to validate the file type for whenever we allow user to upload a file which can be an avatar, a picture or any other type of file for some security reasons. Continue reading “File validation example in PHP”