CUDLR.Server.FindFileType C# (CSharp) Method

FindFileType() static private method

static private FindFileType ( RequestContext context, bool download, string &path, string &type ) : void
context RequestContext
download bool
path string
type string
return void
        static void FindFileType(RequestContext context, bool download, out string path, out string type)
        {
            path = Path.Combine(fileRoot, context.match.Groups[1].Value);

              string ext = Path.GetExtension(path).ToLower().TrimStart(new char[] {'.'});
              if (download || !fileTypes.TryGetValue(ext, out type))
            type = "application/octet-stream";
        }