0

I was wondering is it possible to access a folder not inside the web server? Say for eg. I have a Xammp Installation and inside the htdocs folder I have a web app called MySite which have an Upload Folder

What I wanted to do is redirect all my uploads instead of going to and being saved into MySite\Uploads it will be saved into D:\Data\Uploads.

Is this possible, I presume this should have already been asked many times and answered many times, but I wasnt able to find the right answer maybe because I haven't pinned the right question.

Please help.

1 Answer 1

1

it is possible if the webserver has write rights in that folder.

for example if you do a:

file_put_contents("absolute_path_where_you_want_to_save", $file_contents);

It will work if the user executing the php script has the correct rights (write) to do so.

This is specially useful when READING files that are outside the webserver, for example to retrieve mysql user and password from a file that can't be read even if someone gains access to the folders of your webserver.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.