htmlHandler.GetPages(guid- options)

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.

Can groupdocs load files from a network path?

Thanks




Hi todds,


Thanks for using GroupDocs.Viewer for .NET API.

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);

Please try this in your application and check if it works. For more details, see Html Representation of a Remotely Located Document.

We are looking forward for your feedback.

Warm Regards

Thanks for the reply.

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.

Thanks.

Hi Todds,


Thanks for providing detailed information.

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.

Warm Regards


I could not get the UNC path to work with GetPages passing in the UNC path as a parameter. Let me know what you find out.

I did however fix the problem yesterday by using a stream.

Load the UNC file into a stream.
Use GetPages() passing in the stream


//Opening UNC File into a stream
Stream file = File.OpenRead(@"\\xxx.xxx.xxx.xxx\2016\9\file.xlsx");
List pages = htmlHandler.GetPages(file, options);

Thanks

Hi Todds,


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.

Have a nice day.
Warm Regards

Hi Todds,

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?


We shall be waiting for your response.

Warm Regards