I just installed Nextcloud 10 on a fresh install of Ubuntu 16.04 Server. After getting everything working, I found that I was unable to view or download the Nextcloud Manual or other pdf files that I uploaded. I was able to view and download the other demo files (photos and documents). I googled the issue and found topics that seemed to be somewhat related, but nothing I could identify as being an “aha!” solution.
When I click on a pdf, I get a red bar near the top of the Nextcloud page that states “Unexpected Server Response”. When I expand that, it shows:
What happens if you try and download it instead. Click the three … and select download from the menu. Do you receive an error?
I am able to reproduce the issue by enabling encryption and then disabling the encryption application without decrypting my files. Have you done something similar?
I set up a virtual server and installed Nextcloud on a clean install of Ubuntu 16.04 server, specifically to avoid problems with other applications. It is LAMP on Ubuntu plus Nextcloud, nothing else.
So I reinstalled Nextcloud using the instructions in the link, made sure as much as I could that all the php modules were enabled, and I can now preview and download pdfs(!). So success there, and thanks!
.