I'm adding a feature for downloading files from web servers. I'm testing my program with my own Google Drive account, but I'm not sure how I should deal with the Content-Type Header because I don't know much about web programming.
Firstly, I uploaded two files to my google drive account. Both were the exactly same zip files but I renamed the extension of one of them from "zip" to "ktx" which means nothing before uploading just for the test. After uploading, I checked Content-Type headers of them and got "application/zip" for the original one and "application/x-zip" for the renamed one.
I was confused so searched for the Content-Type Header but just got more confused. Because it seems there are more names for a zip, such as "multipart/x-zip" and "application/x-zip-compressed". So I really want to know if there's a standard naming convention for the Content-Type header.
Anyways I uploaded all the file types I need and below is what I got from Google Drive.
Documents
text/plain (txt)
application/pdf
application/msword (doc)
application/vnd.ms-powerpoint (ppt)
application/vnd.ms-excel (xls)
application/rtf
application/vnd.openxmlformats-officedocument.wordprocessingml.document (docx)
application/vnd.openxmlformats-officedocument.presentationml.presentation (pptx)
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet (xlsx)
Images
image/jpeg
image/png
image/gif
image/tiff (tif, tiff)
image/x-ms-bmp
image/x-photoshop (psd)
image/x-raw (raw)
application/illustrator (ai)
Compressed
application/zip
application/rar
application/x-tar (tar)
application/x-gzip (gz)
application/x-7z-compressed (7z)
application/x-zip (When zip, jar, xlsx or apk is renamed to meaningless one.)
Audio files
audio/mpeg (mp3)
audio/x-wav
audio/x-ms-wma
audio/x-aiff (aiff)
audio/midi (mid)
application/ogg
Videos
video/mp4
video/x-msvideo (avi)
video/x-ms-asf
video/flv
video/quicktime (mov)
video/mpeg (mpg, vob)
video/x-ms-wmv
video/x-matroska (mkv)
Script or Source code files
text/html (htm, html)
text/x-csrc
text/x-c++src
text/x-csharp
text/x-java
text/x-python
text/css
application/x-javascript (js)
application/x-httpd-php
application/json
application/xml
Compiled or Executables
application/x-msdos-program (exe, dll, com, bat)
application/java-vm (class)
application/java-archive (jar)
application/x-python-code (pyc)
application/vnd.android.package-archive (apk)
Etc
application/x-shockwave-flash (swf)
Is there any standard naming convention?
Is it okay just to use the names above to check the MIME type?