Azure Mounted File Storage is not a valid Virtual Path

80 views Asked by At

I have an Azure Mounted file storage in my App Service for storing files.

Path is c:/mountedstorage/appfiles

Im trying to get FileInfo for each file I pull down so I can give the user a download time and show the size of the download.

if (listItem.ToLower().Contains("htmlModules"))
{
    var path = HttpContext.Current.Server.MapPath("~" + listItem);
    if (File.Exists(path))
    {
        var fi = new FileInfo(path);
        length += fi.Length;
    }
}

Issue is that I get the virtual path error like so: ~C:/mountedstorage/appfiles/htmlModules/31822417-dee3-4eab-abdf-fb922d59ccad/runmovie.html' is not a valid virtual path.

Does anyone know how i can get the FileInfo for a file stored on a mounted file share?

0

There are 0 answers