petrsvihlik / WopiHost

ASP.NET Core MVC implementation of the WOPI protocol. Enables integration with WOPI clients such as Office Online Server.
Other
193 stars 74 forks source link

couldn't find the file you wanted #141

Open stormbinary opened 2 years ago

stormbinary commented 2 years ago

oos_01

Hi, Downloaded v2.0 release (https://github.com/petrsvihlik/WopiHost/releases/tag/2.0.0). Set the wopihost to the port that I have available on my pc. Set ClientUrl to the Office Online Server 2016 address I had configured. Obviously can not find the Excel file . I would be grateful for any hint. Thanks.

petrsvihlik commented 2 years ago

Can you debug the app? Specifically, try putting a breakpoint into the checkfileinfo and getfile methods and see if they're hit and what they return. Also, you can check detailed error messages by looking into the windows event viewer. Follow the steps here: https://stackoverflow.com/a/62384305/1332034

stormbinary commented 2 years ago

I was very grateful for responding to my note. a) the four files in the WopiHost\wwwroot\wopi-docs were listed in the browser, otherwise couldn't have selected the test.xlsx. b) when getting the WopiHost.Web -> HomeController -> Index oos_02

I am getting a dot before the file name as you see. Is this the problem?

c) on my online server, there are some errors mostly of this type:

AgentManagerWatchdog reported status AgentManagerWatchdog in category '...'. Reported status: Machine health is Unhealthly. .. WordViewerAppManagerWatchdog has NOT reported recently. ...

d) site https://wopi.readthedocs.io no longer exists and therefore the validator app is 404. Any other sites for docs?

stormbinary commented 2 years ago

WopiHost appsetting { "Wopi": { "UseCobalt": false, "StorageProviderAssemblyName": "WopiHost.FileSystemProvider", "StorageProviderOptions": { "RootPath": ".\wwwroot\wopi-docs" } }, "Logging": { "IncludeScopes": false, "LogLevel": { "Default": "Debug", "System": "Information", "Microsoft": "Information" } } }

WopiHost.Web settings { "Wopi": { "StorageProviderOptions": { "RootPath": "..\WopiHost\wwwroot\wopi-docs" }, "HostUrl": "http://wopihost:12000", "ClientUrl": "http://oos" }, "Logging": { "IncludeScopes": false, "LogLevel": { "Default": "Debug", "System": "Information", "Microsoft": "Information" } } }

stormbinary commented 2 years ago

GetCheckFileInfo and GetFile are functions inside FilesController which are not hit. Furthermore, WopiHost complains "Unable to connect to web server 'IIS Express'", despite the fact that there is port 12000 up on local IIS Express.

stormbinary commented 2 years ago

a) I set my online setup to Set-OfficeWebAppsFarm -OpenFromURLEnabled b) ran http://..../op/generate.aspx# c) got the page "Provide a link that opens Word, Excel, or PowerPoint files in a web browser" d) provided this link https://filesamples.com/samples/document/docx/sample3.docx to open e) after while trying comeback with "An error occurred We're sorry, but for some reason we can't open this for you."

I would appreciate any help. Thank you

stormbinary commented 2 years ago

I have found out that test file in the "%systemdrive%\Program Files\Microsoft Office Web Apps\OpenFromUrlWeb" get downloaded rather than viewed. Also left message at the stack exchange https://stackoverflow.com/questions/71515873/office-file-is-downloaded-rather-than-viewed

petrsvihlik commented 2 years ago

I am getting a dot before the file name as you see. Is this the problem?

That shouldn't be a problem. It seems that the FileInfo is loaded correctly. Dots and double dots are fine, they're just relative pointers.

GetCheckFileInfo and GetFile are functions inside FilesController which are not hit. Then try to find out if the app gets hit at all. Try putting a breakpoint in the AccessTokenHandler.HandleAuthenticateAsync.

Furthermore, WopiHost complains "Unable to connect to web server 'IIS Express'", despite the fact that there is port 12000 up on local IIS Express.

I run the app using Kestrel. I haven't tried IIS Express for a while. Can't help with that.

http://..../op/generate.aspx#

It needs to be a UNC location (starting with \\)

Also left a message at the stack exchange https://stackoverflow.com/questions/71515873/office-file-is-downloaded-rather-than-viewed

Good that you submitted it there. I will try to find some time to reply on StackOverflow.

stormbinary commented 2 years ago

using the UNC for a file, leads to this image

pccai commented 1 year ago

oos must ping/echo wopihost (localhost)

dausdauy commented 1 year ago

image

I also like this,

have you solved? @stormbinary