Syntax:
extBrowObj.GetDownloadTimeDesc(string fullPathToDownloadFile);
extBrowObj.GetDownloadTimeDesc(Int64 sizeOfDownloadFile);
fullPathToDownloadFile: A string representing the full path and file name of the file you wish to estimate the download time for. For example: "c:\inetpub\wwwroot\downloads\file1.zip".
sizeOfDownloadFile: The file size in bytes of the file you wish to estimate the download time for.
This method returns a string that describes the estimated time it will take for a visitor to download a particular file from your web server, based on the size of the file and their detected connection speed.
Examples of this string output include: "< 1 minute", "1 minute", "3 minutes", "1 hour, 17 minutes", "2 hours, 11 minutes", and "> 1 day".
C# Example:
<%
ExtendedOptions options = new ExtendedOptions();
options.AddProperties("ConnectionSpeed");
options.PageMessage = "Please wait while your connection speed is checked…";
ExtendedBrowserObj extBrow = BrowserObj.GetExtendedBrowser(options);
%>
<html>
Estimated time to download this file is: <% Response.Write(extBrow.GetDownloadTimeDesc(@"c:\somePath\filename.zip")); %>
</html>
Note: You must call use GetExtendedBrowser with AddProperties set to test the connection speed prior to calling this method (as shown above).
Note: This method throws a System.IO.FileNotFoundException if the file cannot be found, or a System.UnauthorizedAccessException if the account the visitor is logged in as (IUSR_xxx by default) does not have permissions to read the file. Likewise should BrowserHawk encounter any other exception related to access the file it will pass the exception back to your code.
Note: A return value of N/A indicates that the connection speed test returned a value of 0, and therefore the download time cannot be determined. See the ConnectionSpeed property for information on why it may return 0.
Note: This method requires the Enterprise Edition of BrowserHawk.
See Also: