Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- extension=${1##*.}
- case $extension in
- "323") type="text/h323"
- ;;
- "acx") type="application/internet-property-stream"
- ;;
- "ai") type="application/postscript"
- ;;
- "aif") type="audio/x-aiff"
- ;;
- "aifc") type="audio/x-aiff"
- ;;
- "aiff") type="audio/x-aiff"
- ;;
- "asf") type="video/x-ms-asf"
- ;;
- "asr") type="video/x-ms-asf"
- ;;
- "asx") type="video/x-ms-asf"
- ;;
- "au") type="audio/basic"
- ;;
- "avi") type="video/x-msvideo"
- ;;
- "axs") type="application/olescript"
- ;;
- "bas") type="text/plain"
- ;;
- "bcpio") type="application/x-bcpio"
- ;;
- "bin") type="application/octet-stream"
- ;;
- "bmp") type="image/bmp"
- ;;
- "c") type="text/plain"
- ;;
- "cat") type="application/vnd.ms-pkiseccat"
- ;;
- "cdf") type="application/x-cdf"
- ;;
- "cdf") type="application/x-netcdf"
- ;;
- "cer") type="application/x-x509-ca-cert"
- ;;
- "class") type="application/octet-stream"
- ;;
- "clp") type="application/x-msclip"
- ;;
- "cmx") type="image/x-cmx"
- ;;
- "cod") type="image/cis-cod"
- ;;
- "cpio") type="application/x-cpio"
- ;;
- "crd") type="application/x-mscardfile"
- ;;
- "crl") type="application/pkix-crl"
- ;;
- "crt") type="application/x-x509-ca-cert"
- ;;
- "csh") type="application/x-csh"
- ;;
- "css") type="text/css"
- ;;
- "dcr") type="application/x-director"
- ;;
- "der") type="application/x-x509-ca-cert"
- ;;
- "dir") type="application/x-director"
- ;;
- "dll") type="application/x-msdownload"
- ;;
- "dms") type="application/octet-stream"
- ;;
- "doc") type="application/msword"
- ;;
- "dot") type="application/msword"
- ;;
- "dvi") type="application/x-dvi"
- ;;
- "dxr") type="application/x-director"
- ;;
- "eps") type="application/postscript"
- ;;
- "etx") type="text/x-setext"
- ;;
- "evy") type="application/envoy"
- ;;
- "exe") type="application/octet-stream"
- ;;
- "fif") type="application/fractals"
- ;;
- "flr") type="x-world/x-vrml"
- ;;
- "gif") type="image/gif"
- ;;
- "gtar") type="application/x-gtar"
- ;;
- "gz") type="application/x-gzip"
- ;;
- "h") type="text/plain"
- ;;
- "hdf") type="application/x-hdf"
- ;;
- "hlp") type="application/winhlp"
- ;;
- "hqx") type="application/mac-binhex40"
- ;;
- "hta") type="application/hta"
- ;;
- "htc") type="text/x-component"
- ;;
- "htm") type="text/html"
- ;;
- "html") type="text/html"
- ;;
- "htt") type="text/webviewhtml"
- ;;
- "ico") type="image/x-icon"
- ;;
- "ief") type="image/ief"
- ;;
- "iii") type="application/x-iphone"
- ;;
- "ins") type="application/x-internet-signup"
- ;;
- "isp") type="application/x-internet-signup"
- ;;
- "jfif") type="image/pipeg"
- ;;
- "jpe") type="image/jpeg"
- ;;
- "jpeg") type="image/jpeg"
- ;;
- "jpg") type="image/jpeg"
- ;;
- "js") type="application/x-javascript"
- ;;
- "latex") type="application/x-latex"
- ;;
- "lha") type="application/octet-stream"
- ;;
- "lsf") type="video/x-la-asf"
- ;;
- "lsx") type="video/x-la-asf"
- ;;
- "lzh") type="application/octet-stream"
- ;;
- "m13") type="application/x-msmediaview"
- ;;
- "m14") type="application/x-msmediaview"
- ;;
- "m3u") type="audio/x-mpegurl"
- ;;
- "man") type="application/x-troff-man"
- ;;
- "mdb") type="application/x-msaccess"
- ;;
- "me") type="application/x-troff-me"
- ;;
- "mht") type="message/rfc822"
- ;;
- "mhtml") type="message/rfc822"
- ;;
- "mid") type="audio/mid"
- ;;
- "mny") type="application/x-msmoney"
- ;;
- "mov") type="video/quicktime"
- ;;
- "movie") type="video/x-sgi-movie"
- ;;
- "mp2") type="video/mpeg"
- ;;
- "mp3") type="audio/mpeg"
- ;;
- "mpa") type="video/mpeg"
- ;;
- "mpe") type="video/mpeg"
- ;;
- "mpeg") type="video/mpeg"
- ;;
- "mpg") type="video/mpeg"
- ;;
- "mpp") type="application/vnd.ms-project"
- ;;
- "mpv2") type="video/mpeg"
- ;;
- "ms") type="application/x-troff-ms"
- ;;
- "msg") type="application/vnd.ms-outlook"
- ;;
- "mvb") type="application/x-msmediaview"
- ;;
- "nc") type="application/x-netcdf"
- ;;
- "nws") type="message/rfc822"
- ;;
- "oda") type="application/oda"
- ;;
- "p10") type="application/pkcs10"
- ;;
- "p12") type="application/x-pkcs12"
- ;;
- "p7b") type="application/x-pkcs7-certificates"
- ;;
- "p7c") type="application/x-pkcs7-mime"
- ;;
- "p7m") type="application/x-pkcs7-mime"
- ;;
- "p7r") type="application/x-pkcs7-certreqresp"
- ;;
- "p7s") type="application/x-pkcs7-signature"
- ;;
- "pbm") type="image/x-portable-bitmap"
- ;;
- "pdf") type="application/pdf"
- ;;
- "pfx") type="application/x-pkcs12"
- ;;
- "pgm") type="image/x-portable-graymap"
- ;;
- "pko") type="application/ynd.ms-pkipko"
- ;;
- "pma") type="application/x-perfmon"
- ;;
- "pmc") type="application/x-perfmon"
- ;;
- "pml") type="application/x-perfmon"
- ;;
- "pmr") type="application/x-perfmon"
- ;;
- "pmw") type="application/x-perfmon"
- ;;
- "pnm") type="image/x-portable-anymap"
- ;;
- "pot") type="application/vnd.ms-powerpoint"
- ;;
- "ppm") type="image/x-portable-pixmap"
- ;;
- "pps") type="application/vnd.ms-powerpoint"
- ;;
- "ppt") type="application/vnd.ms-powerpoint"
- ;;
- "prf") type="application/pics-rules"
- ;;
- "ps") type="application/postscript"
- ;;
- "pub") type="application/x-mspublisher"
- ;;
- "qt") type="video/quicktime"
- ;;
- "ra") type="audio/x-pn-realaudio"
- ;;
- "ram") type="audio/x-pn-realaudio"
- ;;
- "ras") type="image/x-cmu-raster"
- ;;
- "rgb") type="image/x-rgb"
- ;;
- "rmi") type="audio/mid"
- ;;
- "roff") type="application/x-troff"
- ;;
- "rtf") type="application/rtf"
- ;;
- "rtx") type="text/richtext"
- ;;
- "scd") type="application/x-msschedule"
- ;;
- "sct") type="text/scriptlet"
- ;;
- "setpay") type="application/set-payment-initiation"
- ;;
- "setreg") type="application/set-registration-initiation"
- ;;
- "sh") type="application/x-sh"
- ;;
- "shar") type="application/x-shar"
- ;;
- "sit") type="application/x-stuffit"
- ;;
- "snd") type="audio/basic"
- ;;
- "spc") type="application/x-pkcs7-certificates"
- ;;
- "spl") type="application/futuresplash"
- ;;
- "src") type="application/x-wais-source"
- ;;
- "sst") type="application/vnd.ms-pkicertstore"
- ;;
- "stl") type="application/vnd.ms-pkistl"
- ;;
- "stm") type="text/html"
- ;;
- "sv4cpio") type="application/x-sv4cpio"
- ;;
- "sv4crc") type="application/x-sv4crc"
- ;;
- "svg") type="image/svg+xml"
- ;;
- "swf") type="application/x-shockwave-flash"
- ;;
- "t") type="application/x-troff"
- ;;
- "tar") type="application/x-tar"
- ;;
- "tcl") type="application/x-tcl"
- ;;
- "tex") type="application/x-tex"
- ;;
- "texi") type="application/x-texinfo"
- ;;
- "texinfo") type="application/x-texinfo"
- ;;
- "tgz") type="application/x-compressed"
- ;;
- "tif") type="image/tiff"
- ;;
- "tiff") type="image/tiff"
- ;;
- "tr") type="application/x-troff"
- ;;
- "trm") type="application/x-msterminal"
- ;;
- "tsv") type="text/tab-separated-values"
- ;;
- "txt") type="text/plain"
- ;;
- "uls") type="text/iuls"
- ;;
- "ustar") type="application/x-ustar"
- ;;
- "vcf") type="text/x-vcard"
- ;;
- "vrml") type="x-world/x-vrml"
- ;;
- "wav") type="audio/x-wav"
- ;;
- "wcm") type="application/vnd.ms-works"
- ;;
- "wdb") type="application/vnd.ms-works"
- ;;
- "wks") type="application/vnd.ms-works"
- ;;
- "wmf") type="application/x-msmetafile"
- ;;
- "wps") type="application/vnd.ms-works"
- ;;
- "wri") type="application/x-mswrite"
- ;;
- "wrl") type="x-world/x-vrml"
- ;;
- "wrz") type="x-world/x-vrml"
- ;;
- "xaf") type="x-world/x-vrml"
- ;;
- "xbm") type="image/x-xbitmap"
- ;;
- "xla") type="application/vnd.ms-excel"
- ;;
- "xlc") type="application/vnd.ms-excel"
- ;;
- "xlm") type="application/vnd.ms-excel"
- ;;
- "xls") type="application/vnd.ms-excel"
- ;;
- "xlt") type="application/vnd.ms-excel"
- ;;
- "xlw") type="application/vnd.ms-excel"
- ;;
- "xof") type="x-world/x-vrml"
- ;;
- "xpm") type="image/x-xpixmap"
- ;;
- "xwd") type="image/x-xwindowdump"
- ;;
- "z") type="application/x-compress"
- ;;
- "zip") type="application/zip"
- ;;
- "*") type="application/octet-stream"
- ;;
- esac
- echo "$type"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement