xowiki::guesstype (public)
xowiki::guesstype fn
Defined in packages/xowiki/tcl/xowiki-form-procs.tcl
Determine a MIME type using ns_guesstype and fall back to extension matching when it returns a generic type.
- Parameters:
- fn (required)
- Filename or path.
- Returns:
- The MIME type, defaulting to application/octet-stream.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set mime [ns_guesstype $fn] if {$mime eq "*/*" || $mime eq "application/octet-stream" || $mime eq "application/force-download"} { # # ns_guesstype was failing, which should not be the case with # recent versions of NaviServer # switch [ad_file extension $fn] { .xotcl {set mime text/plain} .mp3 {set mime audio/mpeg} .cdf {set mime application/x-netcdf} .flv {set mime video/x-flv} .swf {set mime application/vnd.adobe.flash-movie} .pdf {set mime application/pdf} .wmv {set mime video/x-ms-wmv} .class - .jar {set mime application/java} default {set mime application/octet-stream} } } return $mimeXQL Not present: Generic, PostgreSQL, Oracle