uploaded files: no direct link but download.php

Wish to see a specific feature/change in future releases? Feel free to post it here, and if it gets enough "likes", we'd definitely include it in future releases!
Post Reply
User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1160
Joined: 2019-05-21 22:42
Location: Germany
Contact:

uploaded files: no direct link but download.php

Post by onoehring » 2020-11-13 06:49

Hi,

I see the problem, that it's quite difficult to prevent unauthorized access to uploaded files (usually into folder /images).
When a person has the URL, to an image or another files that has been uploaded (also saved there), that person is able to access the file even if the person has no permission to access the concerning table. Here ( viewtopic.php?f=11&t=2856&p=15242#p9355 ) is how this can be prevented - but I have a feature request that this should be changed.

Instead of linking to the file directly, please link to a download script only.

A nice description with example code can be found here: https://www.web-development-blog.com/ph ... le-script/
Each time the user sees an "image" there would also be the need for the use of a script as the "image" might not be in webroot but somewhere on path that is inaccessible by URL.
Also this would introduce changes to the upload behavior as uploaded files may be placed outside the webroot.

I see some work here, but this has been done many times before (e.g. Moodle (moodle.org) a open source learn management system uses this approach) and it would make uploaded files much more secure.

Olaf

Post Reply