Dynamic link to open PDF in public share


This is more of a question than an issue. We’re currently sharing folders (and not individual files) using public share links and we have the Pdf Viewer from the marketplace installed.

If the public link to the folder is example.com/owncloud/s/WC6NyI3KsljHPu7, and I have 2 files named test1.pdf and test2.pdf in this folder, is there a way to open one of those directly in browser using the Pdf Viewer app via the public URL with query parameters? Something ressembling example.com/owncloud/s/WC6NyI3KsljHPu7/test1.pdf#pdfViewer? I know it is possible to this by using a public share link on the file specifically, but our folders can contain 100+ files, so this does not seem like an efficient solution to our problem.

I do not want the files to be downloaded, since our users will get these link from Excel files.

Our current owncloud version is 10.0.10 and Pdf Viewer 0.11.0.

Thank you

Hi exil17,

I don’t think this is possible. You might want to create a feature request at https://github.com/owncloud/files_pdfviewer/issues/ though this repo looks poorly maintained.

If your workflow relies on such a feature, at the moment I only see creating individual public link shares for each file. This might be accomplished with some programming, using the OCS Share API, see https://doc.owncloud.com/server/developer_manual/core/apis/ocs-share-api.html#create-a-new-share

With the resulting ID you can query again and receive the token, which is required to access the public share https://doc.owncloud.com/server/developer_manual/core/apis/ocs-share-api.html#get-information-about-a-known-share

Those direct publlic link shares then will open in the files_pdfviever app.

You would need some mapping in order to populate your Excel fields with the correct links.

So, I don’t see an easy solution for this, maybe any fellow members could provide another approach.


That’s what I thought, thank you very much cortho!

1 Like