Free Support Forum - groupdocs.com

File tree in new version of group docs

Hi,

We are using very old version of GroupDocs Viewer. Now when we are trying to upgrade it many of the methods and classes are obsolete. Earlier there was FileTreeOptions which allowed to get file tree structure of directory path given. Now in new version this class is not available. Can you please guide me on if there is any other class or library need for this in new version?
Earlier below code was used.

public ActionResult LoadFileBrowserTreeData(LoadFileBrowserTreeDataParameters parameters)
		{
			try
			{
				var path = _storagePath;
				if (!string.IsNullOrEmpty(parameters.Path))
					path = Path.Combine(path, parameters.Path);

				var request = new FileTreeOptions(path);
				var tree = _htmlHandler.LoadFileTree(request);

				var result = new FileBrowserTreeDataResponse
				{
					nodes = Utils.ToFileTreeNodes(parameters.Path, tree.FileTree).ToArray(),
					count = tree.FileTree.Count
				};

				return Json(result);
			}
			catch (Exception ex)
			{
				ExceptionManager.HandleException(ex);
				throw ex;
			}
		}

@vijendra.kurmi2014

The current version of the API was designed to be focused to solve the main task - converting files to HTML/PNG/JPG/PDF. All the other responsibilities like reading a list of files and directories should be handled by the client code. In general, LoadFileTree method returns a list of folders and files contained by a directory. The attached load_file_tree.zip (4.0 KB) console application contains implementation of the LoadFileTree method.

Have a nice day!

Hi Vladimir,
Thank you for your quick response along with solution. We are calling groupdocs viewer through jQuery using code snippet like below. I checked https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET-MVC but could not find groupdcs.viewer.all.js script file. Can you please share showcase URL for reference to use groupdocs through jQuery?

 $(function () {
 var localizedStrings = null;
 var thumbsImageBase64Encoded = null;
 $('#divDocViewer').groupdocsViewer({
     localizedStrings: localizedStrings,
     thumbsImageBase64Encoded: thumbsImageBase64Encoded,
     filePath: '@Html.Raw(FileRelativePath)',
     quality: 100,
     showThumbnails: false,
     openThumbnails: false,
     initialZoom: 100,
     zoomToFitWidth: true,
     onlyShrinkLargePages: false,
     zoomToFitHeight: false,
     width: viewerWidth,
     height: viewerHeight,
     backgroundColor: null,

@vijendra.kurmi2014

Unfortunately jQuery version of the UI is not supported anymore. The showcases that you can find at GitHub is based on Angular. The demo can be found at conholdate.app or at groupdocs.app.