Trying to load a file from a network path and getting the error:
Exception message: The filename, directory name, or volume label syntax is incorrect. Exception type: GroupDocsViewerException
Windows authentication on the web site. AppPool identity is set to a user with full control permissions. The network drive has full control by the same user in the AppPool.
If I change the path of the file I'm trying to load, it works fine.
Does not work:
\\xxx.xxx.xxx.xxx\shared\2016\9\file.xlsx
Does work
c:\shared\2016\9\file.xlsx
If I put the network path in file explorer, it brings up the file just fine.
It seems like you are trying to access remotely located file using the IP address. Therefore, you will have to use the GetPages() method a bit differently. Below is a sample code snippet that may work in your case.
Uri documentURL = new Uri(“http://xxx.xxx.xxx.xxx\shared\2016\9\file.xlsx”);
List pages = htmlHandler.GetPages(documentURL, options);
The path is a unc path. The ip address is to a server drive. It is not an url.
We have a shared drive at \\7.101.3.44\shared
full path to the shared drive is \\7.101.3.44\shared\2016\9\file.xlsx. This path gives the original error in the first post.
If I map the drive \\7.101.3.44\shared to a T drive and pass in T:\2016\9\file.xlsx, I get the error. "Could not find a part of the path T:\2016\9\file.xlsx"
I can go into file explorer and paste in the path T:\2016\9\file.xlsx and it loads the file fine.
I have created an investigation ticket against your issue in our Issue Tracking System. We need to do some investigation on whether is it possible to render a document directly from a UNC path. Therefore, please spare us some more time for the investigation.
Meanwhile, you can also try if you are able to get stream of the file using some C#/VB code. If you get the stream then you will be able to render the document using that stream in GetPages() method.
In case of any confusion, please feel free to ask.
It is good to know that you have fixed the problem using file stream. However, as soon as we get result of the investigation, we will notify you here. Please stay tuned with us.
Can you please provide us the version number of GroupDocs.Viewer for .NET API you are using? Also, can you please provide us a sample console application containing the code (rendering file directly from UNC path) so that we can reproduce the issue at our end?