[Bug]: Cannot view online (browser) viewable files (image, mp3, mp4, pdf...) without download permission
⚠️ This issue respects the following points: ⚠️
- [X] This is a bug, not a question or a configuration/webserver/proxy issue.
- [X] This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- [X] Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- [X] I agree to follow Nextcloud's Code of Conduct.
Bug description
In internal shares, when download permission is disabled, the user cannot view a .pdf file.
Steps to reproduce
- Create a folder with a .pdf file in it
- Create an internal share of that folder
- Remove the download permission
- As the recipient, try to open the .pdf in the viewer.
Expected behavior
The .pdf file should be viewable. Viewing files in a public link, with the hide download option enabled, work as expected.
Installation method
None
Nextcloud Server version
master
Operating system
None
PHP engine version
None
Web server
None
Database engine version
None
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- [ ] Default user-backend (database)
- [ ] LDAP/ Active Directory
- [ ] SSO - SAML
- [ ] Other
Configuration report
No response
List of activated Apps
No response
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
No response
I think this is technically not sovable because the pdf viewer needs to be able to download the pdf file in the browser in order to load it into its iframe...
Hello, so we have the same problem with other type of file.
For example images :
www/apps/dav/lib/DAV/ViewOnlyPlugin.php","Line":100,"message":"Access to this resource has been denied because it is in view-only mode.","exception":{},"CustomMessage":"Access to this resource has been denied because it is in view-only mode."}}
odt file could be open by Collabora with error in log
apps/dav/lib/DAV/ViewOnlyPlugin.php","Line":100,"message":"Access to this resource has been denied because it is in view-only mode.","exception":{},"CustomMessage":"Access to this resource has been denied because it is in view-only mode."}}
Same for a pdf
apps/dav/lib/DAV/ViewOnlyPlugin.php","Line":100,"message":"Access to this resource has been denied because it is in view-only mode.","exception":{},"CustomMessage":"Access to this resource has been denied because it is in view-only mode."}}
And a video
apps/dav/lib/DAV/ViewOnlyPlugin.php","Line":100,"message":"Access to this resource has been denied because it is in view-only mode.","exception":{},"CustomMessage":"Access to this resource has been denied because it is in view-only mode."}}
I have issue with a public share as well. Only the first page is displayed, but scrolling to other pages is impossible.
Hi, this was possible at least until NC 27.1.5.1.
This happens as well in public shares (with "hide download" option).
No error in the nextcloud.log
This is reproducable in current NC28.
On NC 28.0.3.2 I recognized that viewing a PDF file in an external link with checkbox "Download verbergen" (Download hidden) works fine but does not when you share a file with a NC user and don't check "Download erlauben" (allow download),
Shareing a file that can not be displayed within the browser view of Nextcloud without the possibility to download it is quite senseless. When I can't download it to use a local software to open ist and I can't open it within the cloud itself - why do you share this file with me? Pictures can be viewed in the browser even if PDF can't be displayed, an -Tag tells the Browser to download the file, too. That's inconsistent.
Most users will expect that the file can be shown in the browser but there is no link shown to download it when download is disabled. But shareing files or folders you can only see as directory entries but can't even view their content, even if nextcloud could show them in the browser, is completely senseless.
I suggest to change "allow download" to "hide download" and just hide the download possibility of files but show them whithin the cloud if there is an app just in the way it is done at external links.
This is just a big mess. When you share a file with the access right "View only" then IMHO everyone would expect that it is possible to view the content of that file (e.g. is allowed to open or preview the file within the Nextcloud webinterface) without having to set the Download permission as well. Otherwise "View only" has to be renamed to something like "List in files app only without access to the actual file content". and I am quite sure that no one really needs such a behaviour.
This also happens to me but only if I follow a direct link to the pdf file. Otherwise, if I open the file navigating inside the folders it can open just fine.
I think this is technically not sovable because the pdf viewer needs to be able to download the pdf file in the browser in order to load it into its iframe...
It worked for years: View only along with Hide download. Anybody, externally, could open the link (PDF) and view it, but download button was hidden. Now, 30+, with the same settings there is a message: To view a shared PDF file, the download needs to be allowed for this file share.
Does not make any sense: why to share a file to view it only, with no download option, while it can't be viewed.
Hi, this was possible at least until NC 27.1.5.1.
This happens as well in public shares (with "hide download" option).
No error in the nextcloud.log
This is reproducable in current NC28.
Same here. I believe, the bug has appeared since 30.x Before that, for years it has worked properly, and logically: I share the file, ie. I allow to view it only, and the 'download' button is hidden when checked 'Hide download button'.
Currently, it does not allow to share PDF files to other people (non geeks) unless Download button is enabled. Very bad behaviour actually.
This is just a big mess. When you share a file with the access right "View only" then IMHO everyone would expect that it is possible to view the content of that file (e.g. is allowed to open or preview the file within the Nextcloud webinterface) without having to set the Download permission as well. Otherwise "View only" has to be renamed to something like "List in files app only without access to the actual file content". and I am quite sure that no one really needs such a behaviour.
I am actually very surprised someone made a decision to change the old, natural behaviour: 'View only + Hide download button' worked very well and was logic.
Done https://github.com/nextcloud/server/pull/53671
@skjnldsv John, thanks for your work. As it's been added to 32, so am I correct that in order to share files externally, we would need to wait ca half a year?
@Piotr-Fr 32 is scheduled in a bit less than 3 months, in September 😊
Thanks!!!
It works in 31.0.9 well, there are some glitches during loading the page/ doc, but the main functionality is retained: i can share a pdf with external users via link and customize it by turning off Download button. Thanks a lot for your work.