-
Notifications
You must be signed in to change notification settings - Fork 335
pdf viewer does not work when a folder is shared via a URL #187
Comments
Same here. This is a post 6 months ago. |
Hi, I too would like to see this feature included in pdf viewer. Would be great if the developers could look into it :) Thanks |
Fixing this problem would help me a great deal as well. |
Yes! That would be great! |
On the other hand, e.g. firefox opens all linked pdf files automatically for viewing using pdf.js - and also for other browsers there's plenty of plugins to display pdf files; so in my opinion the built-in ownCloud pdf-viewer is a nice gimmick, but not really necessary. Is it really that much of a hassle to require users to click the download button? |
I think it's not right to rely on user's software if some functionality misbehaves. The similar problem exists also with TXT viewer on public link. The empty document is displayed until you log in. So the problem is serious. PS. there is also a design mismatch - PDF content frame is displayed under the footer. |
FF (and other browsers) normally do open the PDF file as Plugin in the browser, but - and that's the key point here - the downloads delivered by owncloud include the Content-Disposition: Attachment (or something close to that) header in the download, which forces the browser to download it. Which is quite annoying. |
Update apps/files_pdfviewer/js/loader.js changing line 18 to following code and its work now. if ($('#isPublic').val()){ If you want the shared folder is accessible without logging comment line 3 apps file / files_pdfviewer / viewer.php / / OCP \ User :: checkLoggedIn (); Add a user account with read-only permission and download and add the following line in the file viewer.php if ($ _GET ['IsPublic']) { |
@midoriatlantica can you be a little more clear in your steps to fix this? I tried what you said on owncloud 5.0.13 (as best as i could follow it) and it still didnt work. It said my PDF was corrupted. Any advice? |
@midoriatlantica, the same here. I still get "PDF is corrupted". |
The PDF viewer implementation doesn't know how to load public files and only works with internal files. As per the linked ticket the issue also exists in OC 5.0.13 |
The problem with the way public share , is more specifically associated with the user session . A work solution found for me solve this problem is as follows: [apps/files_pdfviewer/viewer.php] After Line 6 added a check to see if there is a logged in user , if there is no attribute session user_id [ apps / files_sharing / templates / public.php ] [core / js / js.js ] function setSession(SessionName, SessionValue) { Call the function when loading the DOM create file setsession.php in the folder where it was installed ownCloud [apps / files_pdfviewer / js / loader.js ] if($('#isPublic').val()){ if( var viewer = OC.linkTo('files_pdfviewer', 'viewer.php')+'?dir='+encodeURIComponent(url).replace(/%2F/, '/')+'&file='+encodeURIComponent(filename.replace('&', '%26'))+'&isPublic='+$('#isPublic').val(); |
@midoriatlantica I think if you put the user_id into the session it is the same as authenticating as the file owner, which is a security issue! This means the viewing use would then be logged in as that user and can edit all their files. The problem is mostly that the way to access the file contents is different in public mode, it somehow needs to go through the public API / public.php |
PDFViewer need an authenticated user to view the file. But in case of sharing via link I think you will not have a user registered in the system will only be a guest user. In this case the only way to circumvent this problem is to create a user with only permission to download and display. For me this solution met perfectly, and I see no problem. |
Due to many reports of this for OC 5.0.13 I will attempt to backport the workaround to stable5. |
It looks like the fix has already be ported to stable5 and will appear in OC 5.0.14. Leaving this ticket open for the proper implementation of the PDF view in public mode. |
midoriatlantica, you didn't complete your post :) What code should be added into [ apps / files_sharing / templates / public.php ] ? |
I sent the full post, but it seems that there is a character limit. |
Please code full. i need this code. |
Can you post the code public.php? |
@PVince81 Which fix did you mean? It doesn't work for OC6 |
@kabum The fix should disable the PDF viewer in public mode. Do you still see it or see an iframe with a login page ? |
@PVince81 No, it just downloads the PDF. |
Yes, I confirm. PDF viewer is disabled in fresh OC v6 install. Just download works. |
Yes, that's the correct behavior for now (quickfix). |
Any chance to see viewer in future? |
Yes, let's keep this issue opened as feature request to add it. |
@frank: re-enacted for Versions 5.0.13, 5.0.14a and 6.0.2 |
@karlitschek : no longer reproducible in 6.0.2.4 |
Any updates on when this will be fixed. For now I've setup Chrome to automatically open PDF files once they've downloaded. Ideally I don't want the files to download at all...having the PDF open in the embedded PDF viewer like it does if we login to owncloud is what I would prefer. |
@dietmaroc does this mean the issue is rectified in 6.0.2.4 ? |
@PVince81 any update on this issue? @midoriatlantica does your fix/hack work on OC6? any chance of posting a full guide? |
I didn't have time to work on this, sorry. If anyone has an idea how to fix it, even partially, please do so. |
@PVince81 somewhat related is there a way I can pass credentials in a URL as a workaround to this without having to hack the code as @midoriatlantica did? |
Hi all! I've been working on this feature yesterday and with a little help from everyone on this thread ownCloud 7 (coming soon™) will include the PDF viewer for shared PDF files! To get this into ownCloud 7 we need your help in testing this feature. - To do this:
Afterwards test the following things:
If you've performed all these tests report in owncloud/files_pdfviewer#7 whether the feature works or not. If enough people have tested this functionality it will get merged in time for the upcoming ownCloud release. |
Ping at everybody in this issue. If my pull request does not get enough reviews it won't get included in ownCloud 7. If you don't want to wait another half a year you really should take those 15 minutes to test my changes ;-) |
This will be fixed with ownCloud 7. |
When a folder is shared via a URL to a external entity, the embedded pdf viewer does not work.
The same folder when a user is logged into the webclient displays correctly in the pdfviewer.
However if the folder is shared via a URL the pdfviewer doe not display the pdf.
The image viewer and the odt client are both working correctly.
Regards
The text was updated successfully, but these errors were encountered: