Full form of MIME is Multipurpose Internet Mail Extensions. It is basically the file type, in other words format of the file. If we take an example of an image, its type can be of “png”,”jpg” etc. These are known as file extension but on web we have to specify about it as “image/png”, “image/jpeg” this tell specifically about the type of file you are downloading, uploading or using for some other purposes. Web developers also uses these mime type for validating file type that the user is uploading.
Some of the common MIME Types are:
MIME Type of Image, PNG, JPG, JPEG, GIF
PNG - image/png
JPG - image/jpeg
JPEG - image/jpeg
GIF - image/gif
MIME type for MS Word, PDF, Power Point, Excel and Notepad
DOC - application/msword
DOCX - application/vnd.openxmlformats-officedocument.wordprocessingml.document
PDF - application/pdf
PPT - application/mspowerpoint
CSV - text/csv
XLSX - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
XLS - application/vnd.ms-excel
TXT - text/plain
Normally we use a “form” tag with attributes such as “action (the page on which you want to redirect when a person clicks on submit button”, “method – post or get”. To upload any file on server you have to add an additional attribute “enctype= multipart/form-data”. It is a mandatory attribute for uploading purpose but if you are uploading your file through jQuery, you need not to worry about the attribute. Without attribute “enctype= multipart/form-data” you can upload your file to server.
How to upload a file with PHP?