Pdf's for guest users not working


(Carl Moebis) #1

So, in the Staff category there is a post called “Assets for site design” where we host things like images and pdf’s to share elsewhere on the site. The images work for guests permissions wise, but the pdf’s show a “Oops! That page doesn’t exist or is private” unless you’re logged into the forums. I checked the allowed file extensions and pdf is there.


(Jeff Atwood) #2

What version of Discourse? I can’t repro this. I just uploaded a test PDF to the staff category at discourse.codinghorror.com and here’s a link to it

https://discourse-cdn.codinghorror.com/uploads/default/original/3X/d/1/d1f7e61bc10c7bee70973ea171f21c972196a5f5.pdf

As you can see it is freely available, but note that it went to the CDN. Even if it didn’t, there is no concept of upload permissions in Discourse.


(Carl Moebis) #3

v2.2.0.beta5 +35 and here is the PDF in that topic: https://community.intelligentfanatics.com/uploads/default/original/1X/6d69d0b1f004ac38ffa8e081774009dc4819c475.pdf …no CDN. If you’re logged into the forum however it does open.


(Jeff Atwood) #4

Maybe you should set up a CDN? It is good practice regardless.


(Carl Moebis) #5

We use a CDN for the blog side (Cloudflare) but I thought I read somewhere that it’s not suggested to be used with Discourse. Either way, is that the solution? Everything is working as designed?


(Jay Pfaffman) #6

I remember some discussion of protecting uploads from non logged in users and thought that something had been added. I don’t see a site setting about it, though.

@moebis, you might try moving those images to a public topic that’s (that word that means doesn’t show up in searches).


(Régis Hanol) #7

It’s called “prevent anons from downloading files” but it’s not compatible with a CDN.


(Jay Pfaffman) #8

@moebis, do you have that site setting enabled? I believe that would explain your problem.

@zogstrip, perhaps that site setting should have the word “uploads” in the description.


(Carl Moebis) #9

That worked! Thank you. I disabled it and that link now works. Perfect! Much appreciated. So this was a recent change?


(Régis Hanol) #10

Nope, that setting has been in Discourse for 4 years :wink: