From 0972b0f827d26142e6008e119674f3e5cc96ddf9 Mon Sep 17 00:00:00 2001 From: "premkumar.madhanraj" Date: Mon, 6 Dec 2021 15:00:37 +0530 Subject: [PATCH] Fetching details of multiple files/folder not sending the location properly issue has been resolved. --- Models/PhysicalFileProvider.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Models/PhysicalFileProvider.cs b/Models/PhysicalFileProvider.cs index 1b92f47..c8325ad 100644 --- a/Models/PhysicalFileProvider.cs +++ b/Models/PhysicalFileProvider.cs @@ -346,15 +346,16 @@ public virtual FileManagerResponse Details(string path, string[] names, params F FileInfo info = new FileInfo(fullPath); fileDetails.Name = previousName == "" ? previousName = data[i].Name : previousName = previousName + ", " + data[i].Name; fileDetails.Size = (long.Parse(fileDetails.Size) + (((File.GetAttributes(fullPath) & FileAttributes.Directory) != FileAttributes.Directory) ? info.Length : GetDirectorySize(new DirectoryInfo(fullPath), 0))).ToString(); - relativePath = GetRelativePath(baseDirectoryParentPath, info.Directory.FullName); - previousPath = previousPath == "" ? relativePath : previousPath; - if (previousPath == relativePath && !isVariousFolders) + previousPath = previousPath == "" ? GetRelativePath(baseDirectoryParentPath, info.Directory.FullName) : previousPath; + if (previousPath == GetRelativePath(baseDirectoryParentPath, info.Directory.FullName) && !isVariousFolders) { - previousPath = relativePath; + previousPath = GetRelativePath(baseDirectoryParentPath, info.Directory.FullName); + fileDetails.Location = GetRelativePath(baseDirectoryParentPath, info.Directory.FullName).Substring(1); } else { isVariousFolders = true; + fileDetails.Location = "Various Folders"; } } fileDetails.Size = byteConversion(long.Parse(fileDetails.Size)).ToString();