Disable force file download on public link

I have a public share link for example:

If I enter this link in my browser (Opera), then he will download this file without problems, but i want to preview this file in browser directly. How can I do that? Is it possible with a .htaccess file or something else?

Best regards,

Try this:

It will open every pdf file like other pdfs in the internet. There is another application, like an e-book format. But the pdf.js is the most common.

Edit: Here is the other one:

Files_Reader App Store

If the “download” is in the link it will download. Otherwise it should show the web browser …

Sorry thats not what i want. I have this app installed in nextcloud. I want to preview the pdf file outside of nextcloud, only with the above link.

Okay thanks, but how must be the url for that?

For example:


That dont works for me…

This isn´t what you want? I think its a preview :smiley:

Link is:

Download link instead is:

Maybe you can explain it a little bit more what you want. Because I do not know what you mean.

Yes, its a preview, but its opened in nextcloud self. I want to show my pdf file in my browser directly without an app inside nextcloud. My share link is for a folder and inside that folder there is a pdf file. Do you know what i mean? :slight_smile:

You want to disable the blue frame, where you can choose on the upper right side: download / download-link and ‘add to nextcloud’???

Is that what you want to only open pdf without any nextcloud frames?
Well, what the matter? I think its the same like Dropbox?

No, i dont want to disable the blue frame. Yes, without any nextcloud frames. Ok I try to explain more:

I have a folder in nextcloud for public access -> public share link -> /index.php/s/X5qM4yKsirPI5HT
In that folder I have a .pdf file -> test.pdf

What I need is a direct link to my pdf file like this:

This example shows what i mean. Its a pdf, that the browser can open directly. All what i need is to disable the force download for my file. It should open, not download, but without in nextcloud. Another example:

I create a link like:
<a href="test.pdf" target="_blank">my pdf file</a>

Hope this helps to understand, what i mean…

Sorry, but for now I am confused.

Look at my Screenshot, isn´t it the same?

My first app link (pdf.js) will open pdf´s similiar like your google link:

Thats contradictory :smiley:

Ok i think i know what you mean. Do you have created a public share link for pdf ? Cause my share link is for a folder, not a file… Sure, i can set a share link for my file too… but if i have many files…

Yes, I created public link for bitcoin.pdf :smiley:

I just cutted it out of my browser. On the right you see the scrollbar. :wink:

Allright, now i understand how it works. Thanks for your time :slight_smile: So i can share a file directly and have a perfect preview link to the file. But i think its hard to create share links for each pdf file manually. Thats the reason how i think about a share link for a folder and create the url with the share link (my folder) + file001.pdf…, file002.pdf and so on…

No you dont need to share every file. Just download files_pdfviewer:

to your apps folder. chown it to www-data and then even a pdf in a folder should be open with pdf.js

Yes I know. I go in my nextcloud folder -> click on my pdf file and its opening with the app files_pdfviewer.

So I have a list on my website, that shows ID numbers. What i want is to link every number to the correct pdf file in nextcloud. With other words: I want not going in my nextcloud and click on my file to preview it. I go in my list on my website (other domain), click on the generated link (with php and curl) which shoud be the link to the pdf file in nextcloud. I hope you understand, what iam trying to do :slight_smile:

Is the form for the correct link then.

OP wants to batch generate share links for individual pdf files (right?)