PDF viewer not working with shared links
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Steps to reproduce
- Update on Nextcloud version 30
- Open a PDF with the Viewer
Expected behaviour
Tell us what should happen Normaly it you should see the PDF
Actual behaviour
Tell us what happens instead, if possible also add a screenshot When I open the PDF a black screen appears
Server configuration
Database: MySQL/Maria/SQLite/PostgreSQL MariaDB
Nextcloud version: (see Nextcloud admin page) 30.0.0
List of activated apps
Auditing / Logging Brute-force settings External storage support File sharing Files download limit Nextcloud webhook support Password policy Share by mail PDF Viewer 3.0.0If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder
Nextcloud configuration
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder
Browser
Browser name: Firefox/Chrome/Safari/… In every Browser it doesnt work Browser version: 124/125/…
Operating system: Windows/Ubuntu/Mac/… Windows
Browser log
Insert your browser log here, this could for example include:
a) The javascript console log
b) The network log
Browser Console
I use docker and there the Nextcloud container: https://hub.docker.com/layers/library/nextcloud/30.0.0/images/sha256-0f19a49f4169d4622128f73b8b84110dccd8d7b6c925e1cc54860914be549e89?context=explore
Not working:
Working (If iam logged in):
Hi,
I can confirm that I have the same bug on my side. The preview don't work on shared links, but it works when authenticated.
I think the problem is that it returns an HTTP 401 when the preview script tries to fetch the PDF.
I noticed a 401 error on this kind of links :
https://redacted-server.com/public.php/dav/files/3mQSWszDagxCo7p/
Edit : I'm also on Nextcloud V30
Edit 2 : However, the download of the file works fine, no 401 on this.
Also affected.
If I disable both PDF Viewer and Built-in Collabora Server (but not remove them), then at least somehow Nextcloud Office still finds the Builtin Collabora in apps, and generates a preview. It's ugly but it's something.
I think this is also related and it's where I got the idea from; https://help.nextcloud.com/t/pdf-files-wont-open/188277/9
Possibly related: #946
I think I have the same issues on MP3 files. The mp3 player does not show up and I have the same 401 errors (but I can still download the file).
So it may be a broader issue with the previewing of all public/shared files.
EDIT: Similar error with mp4 file. But images & .md files previews are working.
I tracked down where the 401 is coming from.
apps/dav/appinfo/v2/publicremote.php , starting at line 78.
if ($federatedShareProvider->isOutgoingServer2serverShareEnabled() === false && !$isAjax) { // this is what is thrown when trying to access a non-existing share throw new NotAuthenticated(); }
I tested by comment out the throw line and I was able to view the PDF as expected.
Noticing isOutgoingServer2serverShareEnabled , I took a look in Administration settings -> Sharing -> Federate Cloud Sharing and noticed this setting which was off. Turning it on (with the throw back in the above code) also fixes the issue.
Allow people on this server to send shares to other servers (this option also allows WebDAV access to public shares) .
Thanks @boutilpj, from what I managed to find, it seems to be fixed in a recent commit bbc5d32c8e14de78ae12c3acea384c69d2264eca in this pull request 48628
Thanks @madrzejewski and indeed Nextcloud update to 30.0.1 fixed it.
Greetings to all Most probably I am not getting many answers as this is already "closed" but I will try anyway as it seems I am still having the same issue, although a bit different, even using version 30.0.2
When a share a pdf file with the "hide download" option the file doesn´t open. It keeps on loading and just don´t open. No matter I am logged in or not. However, the same, which is under a folder, if I share the folder and then opens the files individually it open without any problems.
I notice that on the URL, using this second option, there is kind of an instruction "openfile". I have no idea what it means.
Here is the file that doesn't open: https://bdm-files.usj.edu.mo/index.php/s/rZdKxRRN7m8nk4r
Here is the folder with the file inside and from her it opens without any issues: https://bdm-files.usj.edu.mo/index.php/s/NP6iY4p6z5mtse6
Thank you very much
Best regards,