Shared Hosting | Absolute location of a file

Author - Webner

If you want to access a file on a shared hosting server by specifying its absolute location it may not work. The reason is what we see on shared hosting as root folder actually may have more before it that is not visible to us for security reasons (as machine has shared hosting). The solution is to use Apache/Web server’s ‘DOCUMENT_ROOT’ variable before file path. Like in PHP use it as:

$_SERVER['DOCUMENT_ROOT']/home/myfolder/myfile.csv

Webner Solutions is a Software Development company focused on developing CRM apps (Salesforce, Zoho), LMS Apps (Moodle/Totara), Websites and Mobile apps. If you need Web development or any other software development assistance please contact us at webdevelopment@webners.com

Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Leave a Reply

Your email address will not be published. Required fields are marked *