Hi,
I'm trying to modify the upload_demo.php to upload files outside of the public_html directory. Is this possible?
Here's what I've tried, but it doesn't work:
$folder = $_SERVER['DOCUMENT_ROOT']."/../files/";
Any help would be appreciated :)
» PHP Forum Archive » PHP Classes Support Forum » Easy Upload class Support forum
Hi,
I'm trying to modify the upload_demo.php to upload files outside of the public_html directory. Is this possible?
Here's what I've tried, but it doesn't work:
$folder = $_SERVER['DOCUMENT_ROOT']."/../files/";
Any help would be appreciated :)
Hi,
sure you can if you have write acccess.
echo $_SERVER['DOCUMENT_ROOT']
from your public root folder and modify the path you got and use it as your upload path
That worked great! Thanks!
method seems to be the simplest and most elegant way to protect read-only files that, for whatever reason, must be stored in public_html. In this example, we protect configuration.php, perhaps the most confidential file of any Joomla! site. Using this method, even if the Web server somehow delivers the contents of PHP files, for example due to a misconfiguration, nobody can see the contents of the real configuration file.