Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open PDF inside shared folders #305

Closed
hmt opened this issue Feb 5, 2021 · 15 comments
Closed

Cannot open PDF inside shared folders #305

hmt opened this issue Feb 5, 2021 · 15 comments

Comments

@hmt
Copy link

hmt commented Feb 5, 2021

Describe the bug
A publicly shared PDF inside a folder cannot be opened in the viewer. It says Invalid or corrupted PDF file

To Reproduce
Steps to reproduce the behavior:

  1. Create folder and add PDF file to it
  2. Share folder and create public link
  3. Open public link
  4. Click on PDF file to view

Expected behavior
File can be viewed

Screenshots
image
File cannot be viewed

** Platform **
everywhere

Browser log

Uncaught (in promise) Error: Invalid or corrupted PDF file.
    _callee7$/</< app.js:817
    promise callback*_callee7$/< app.js:815
    promise callback*_callee7$ app.js:776
    Babel 8
        tryCatch
        invoke
        method
        asyncGeneratorStep
        _next
        _asyncToGenerator
        _asyncToGenerator
        open
    webViewerOpenFileViaURL app.js:1947
    webViewerInitialized app.js:1917
    promise callback*run app.js:478
    webViewerLoad viewer.js:218
    EventListener.handleEvent* viewer.js:228
    Webpack 3
        __webpack_require__
        <anonymous>
        <anonymous>
app.js:817:16

Additional context
It is fine to share a single PDF. A single PDF can be opened just fine. This only happens for PDF files that are in a shared folder.
This happened immediately after the 20.0.7 update.
First posted here: nextcloud/viewer#764

@RealKelsar
Copy link

Hi,

same Problem here, but I notice it tries a Auth Call to our SAML Provider, but that one gets suppresed by the browser because of CSP.

Opening the same PDF in OnlyOffice from the context Menu does work finde and I do not see such a call there.

@RealKelsar
Copy link

Guess it is the same Issue as in #286

@hmt
Copy link
Author

hmt commented Feb 5, 2021

Yes, you're correct. Didn't see that bug. But for me this only appeared in 20.0.7

@RealKelsar
Copy link

Same here.

@Hanskes
Copy link

Hanskes commented Feb 5, 2021

Same problem here, since update to 20.0.7

@szaimen
Copy link
Collaborator

szaimen commented Feb 7, 2021

cc @skjnldsv

@ksteinb
Copy link

ksteinb commented Feb 8, 2021

Same here

@Mehvix
Copy link

Mehvix commented Feb 8, 2021

Same here.

@dsiminiuk
Copy link

+1

@nderambure
Copy link

This is the same bug than here : #207

@wankdanker
Copy link

The problem is that the URL that is fetched by the PDF viewer appears to be URL encoded like:

https://cloud.nendzynski.de:8443/index.php/s/o49EBjHoe78GQEj/download%3Fpath%3D/%26files%3DTest.pdf

Where it should be:

https://cloud.nendzynski.de:8443/index.php/s/o49EBjHoe78GQEj/download?path=/&files=Test.pdf

And the server responds with a 302 redirect to the login page.

image

I am not familiar with the code base, but I'm trying to trace where the URL is generated. Maybe this will help someone else though.

@LPJon
Copy link

LPJon commented Feb 10, 2021

Same here. I get this error on Shared PDF Viewing ONLY:
Nextcloud Version v20.0.7

PDF.js v2.4.456 (build: 228a591c)
Message: Invalid PDF structure.

@dsiminiuk
Copy link

It looks like a fix is in progress in #309

@skjnldsv
Copy link
Member

fix in #319

@hmt
Copy link
Author

hmt commented Feb 19, 2021

Tahnks for fixing this bug. Is it possible to get the app released as an update any time soon? People are shouting at me all the time because they don't understand how to download a pdf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests