error 403 when clicking preview

Phoca Download - download manager
barredespace
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 06 Mar 2023, 10:35

error 403 when clicking preview

Post by barredespace »

Hi,

I get a 403 whenever I ask for a preview. Tried for several files, same result.

Joomla 4.2.8 / PhocaDownwload 4.0.5

Preview settings have Display Preview Button set to Yes, userupload directory has 755 permissions and files have 644.

Files have Access setting set to Public or Registered and for those with registered, I tried with a registered account.

Those files are perfectly downloadable and the fields Filename and File - Preview share the same path.

Don't know where else to look for to find the culprit.
Any ideas ?

Thanks,
--
Pascal
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48361
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: error 403 when clicking preview

Post by Jan »

Hi,

"An HTTP 403 response code means that a client is forbidden from accessing a valid URL. The server understands the request, but it can't fulfill the request because of client-side issues."

So this is maybe a question on webhosting provider. :idea.

BTW did you test it with different browsers?

Jan
If you find Phoca extensions useful, please support the project
barredespace
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 06 Mar 2023, 10:35

Re: error 403 when clicking preview

Post by barredespace »

Hi Jan,

In my understanding, a 403 error means the server can't fulfill the request because the client asked for a resource it has no permission to access. That's why I searched for the source of my problem in that direction : access management, rights, permissions etc.
I also checked the permissions on the server, checked with and without .htaccess…
I did check with Chrome, Safari and Firefox and had the same result.

Thanks
--
Pascal
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48361
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: error 403 when clicking preview

Post by Jan »

Hi, in Phoca Download, when user cannot access files because of not logged in or not having permissions, standard message is displayed to him/her. The 403 can even come from system, but Phoca Download does not display 403 usually :idea:

Jan
If you find Phoca extensions useful, please support the project
barredespace
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 06 Mar 2023, 10:35

Re: error 403 when clicking preview

Post by barredespace »

Hi, the strangest thing here is that it's the exact same path that gives a file ok when download is clicked and a 403 when it's the preview 🤪

--
Pascal
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48361
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: error 403 when clicking preview

Post by Jan »

Are you really sure, both links are 100% the same? If yes, are you able to test it with another IP?
If you find Phoca extensions useful, please support the project
barredespace
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 06 Mar 2023, 10:35

Re: error 403 when clicking preview

Post by barredespace »

Just to be 100% sure, I just copy-pasted the link from Filename field to Preview field : same result : I can download the file but not preview it.
I suspected it may have something to do with the fact that all files are pdfs, so I tried with a jpeg preview file : same result.

The actual download link is like

Code: Select all

https://[MY-WEBSITE-URL]/telechargements/23-l-association/2-fiches-de-films?download=7:l-analyse-des-films-d-adherents-au-camap
when the preview link is

Code: Select all

https://[MY-WEBSITE-URL]/phocadownloadpap/userupload/fiches_de_films/l_analyse_des_films_d_adherents_au_camap.pdf

But, I think you are right, it's something with my server configuration / htaccess or security component I guess. I'll investigate some more and be sure to report here if / when I find out !

And yes, I checked from work and from home and even with a proxy with the same result.
--
Pascal
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48361
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: error 403 when clicking preview

Post by Jan »

Hi,

- the download link goes to the file per system and can be managed by Phoca Download
- the preview link is a direct link to the file on server (and maybe the direct way is just protected from accessing - btw - this is even the reason why Phoca Download has two different folders - one for download and second for play and preview - one can be protected and second is open to the world - but maybe in this case, the direct access could be even protected by some server rule :idea: )

Jan
If you find Phoca extensions useful, please support the project
Post Reply