internal static string ConvertFileNameToUrl(string fileName)
{
string prefix;
if (IsAbsoluteLocalPhysicalPath(fileName))
{
prefix = FileUrlLocal;
}
else
{
if (IsAbsoluteUncPhysicalPath(fileName))
{
prefix = FileUrlUnc;
}
else
{
// We should never get here, but if we do we are likely to have
// serious security problems, so throw an exception rather than simply
// asserting.
throw ExceptionUtil.ParameterInvalid(nameof(fileName));
}
}
string newFileName = prefix + fileName.Replace('\\', '/');
return(newFileName);
}