server icon indicating copy to clipboard operation
server copied to clipboard

[Bug]: Cannot view online (browser) viewable files (image, mp3, mp4, pdf...) without download permission

Open artonge opened this issue 3 years ago • 15 comments

⚠️ This issue respects the following points: ⚠️

Bug description

In internal shares, when download permission is disabled, the user cannot view a .pdf file.

Steps to reproduce

  1. Create a folder with a .pdf file in it
  2. Create an internal share of that folder
  3. Remove the download permission
  4. 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

artonge avatar Nov 23 '23 11:11 artonge

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...

szaimen avatar Nov 29 '23 09:11 szaimen

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."}}

aukfood avatar Dec 01 '23 15:12 aukfood

I have issue with a public share as well. Only the first page is displayed, but scrolling to other pages is impossible.

maximelehericy avatar Apr 11 '24 14:04 maximelehericy

Hi, this was possible at least until NC 27.1.5.1.

This happens as well in public shares (with "hide download" option).

grafik

No error in the nextcloud.log

grafik

This is reproducable in current NC28.

t-markmann avatar May 08 '24 07:05 t-markmann

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.

Volker-K avatar May 17 '24 08:05 Volker-K

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.

fishgit avatar Dec 03 '24 09:12 fishgit

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.

fabreupeixoto avatar Dec 06 '24 01:12 fabreupeixoto

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.

Piotr-Fr avatar Apr 12 '25 21:04 Piotr-Fr

Hi, this was possible at least until NC 27.1.5.1.

This happens as well in public shares (with "hide download" option).

grafik

No error in the nextcloud.log

grafik

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.

Piotr-Fr avatar Apr 12 '25 21:04 Piotr-Fr

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.

Piotr-Fr avatar Apr 14 '25 07:04 Piotr-Fr

Done https://github.com/nextcloud/server/pull/53671

skjnldsv avatar Jul 01 '25 13:07 skjnldsv

@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 avatar Jul 01 '25 14:07 Piotr-Fr

@Piotr-Fr 32 is scheduled in a bit less than 3 months, in September 😊

skjnldsv avatar Jul 01 '25 14:07 skjnldsv

Thanks!!!

Piotr-Fr avatar Jul 01 '25 14:07 Piotr-Fr

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.

Piotr-Fr avatar Sep 30 '25 12:09 Piotr-Fr