Doug Chu
Doug Chu

Reputation: 1

where to store my sensitive files in cPanel?

I have a website that uses PHP and runs on Cpanel. I have some .xls and.pdf files that I want only for my customers who have an account to be able to download, and I also have some .json and .csv files that I only use in the backend (via PHP code) and I don't want anyone to be able to download them.

Can I upload everything to the public_html and store them in unguessable directories like "/0909278348734873847/file.json"? does it do the job? Should I upload things outside of public_html? can I then access them via PHP? or is it something else? thanks for your answers in advance.

Upvotes: 0

Views: 248

Answers (1)

Nimal V
Nimal V

Reputation: 176

.You can place the sensitive file outside public_html.Files outside of public_html are protected from being seen on the web. Many people use that feature as a security to their content. If you have a file on there that you want to show contents of though, you have to use the include('data.php'); or include_once('data.php'); or even require_once('data.php') in a public ally visible file. ie, a file you have in public_html has to be the one to call the higher up file. By this you can programatically control the access to sensitive data

Upvotes: 1

Related Questions