Using the HTML5 File API to upload files, I am currently using some hardcoded checking of the browsers that support them, depending on the user agent string:
internal bool IsHtml5FileUploadCapable
{
get
{
var browser = Request.Browser;
var n = browser.Browser.ToLowerInvariant();
var major = browser.MajorVersion;
var minor = browser.MinorVersion;
return
n.Contains(@"chrome") && major >= 6 ||
n.Contains(@"ie") && major >= 10 ||
n.Contains(@"firefox") && (major >= 3 && minor > 6 || major >= 4) ||
n.Contains(@"opera") && (major >= 11 && minor >= 5 || major >= 12) ||
n.Contains(@"safari") && major >= 4;
}
}
What I love to use would be the built-in "App_Browsers" functionality in conjunction with the HttpBrowserCapabilities
class.
My question:
Is it possible to deduce the ability of a browser to support the HTML5 File API directly from the browser capabilities?