Skip to content

Instantly share code, notes, and snippets.

@embayer
Created April 21, 2015 21:23
Show Gist options
  • Save embayer/8955184b399c2deaa369 to your computer and use it in GitHub Desktop.
Save embayer/8955184b399c2deaa369 to your computer and use it in GitHub Desktop.
mimetype mapping
media_types = {
"": "application/octet-stream",
".aif": "audio/aiff",
".aiff": "audio/aiff",
".au": "audio/basic",
".avi": "video/avi",
".bmp": "image/bmp",
".bz": "application/x-bzip",
".bz2": "application/x-bzip2",
".c": "text/x-c",
".class": "application/java",
".conf": "text/plain",
".cpp": "text/x-c",
".crt": "application/x-x509-ca-cert",
".css": "text/css",
".csv": "text/csv",
".doc": "application/msword",
".dot": "application/msword",
".flv": "video/x-flv",
".gif": "image/gif",
".gz": "application/gzip",
".h": "text/x-h",
".htm": "text/html",
".html": "text/html",
".ico": "image/x-icon",
".inf": "application/inf",
".java": "text/x-java-source",
".jfif": "image/jpeg",
".jpe": "image/jpeg",
".jpeg": "image/jpeg",
".jpg": "image/jpeg",
".js": "application/javascript",
".json": "application/json",
".lst": "text/plain",
".lzh": "application/x-lzh",
".lzs": "application/x-lzh",
".m1v": "video/mpeg",
".m2v": "video/mpeg",
".m4v": "video/mpeg",
".mid": "audio/midi",
".midi": "audio/midi",
".mov": "video/quicktime",
".mp3": "audio/mpeg3",
".mpeg": "video/mpeg",
".mpg": "video/mpeg",
".ogg": "application/ogg",
".pdf": "application/pdf",
".pl": "text-script.perl",
".png": "image/png",
".pps": "application/mspowerpoint",
".ppt": "application/powerpoint",
".ps": "application/postscript",
".py": "text/x-script.python",
".qt": "video/quicktime",
".ra": "audio/x-realaudio",
".rss": "application/rss+xml",
".rtf": "text/rtf",
".s": "text/x-asm",
".sgm": "text/x-sgml",
".smgl": "text/x-sgml",
".sh": "application/x-sh",
".shtml": "text/html",
".swf": "application/x-shockwave-flash",
".tar": "application/x-tar",
".tcl": "application-xtcl",
".text": "text/plain",
".tgz": "application/x-compressed",
".tif": "image/tiff",
".tiff": "image/tiff",
".txt": "text/plain",
".uu": "text/x-uuencode",
".uue": "text/x-uuencode",
".wav": "audio/wav",
".wmv": "video/x-ms-wmv",
".wp5": "application/wordperfect",
".wp6": "application/wordperfect",
".xbm": "image/xbm",
".xl": "application/excel",
".xls": "application/excel",
".xml": "text/xml",
".z": "application/x-compressed",
".zip": "application/zip"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment