If I don’t know the public web directory, is there a way my script could determine the web directory, so that the script would know which directory to upload the file to?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are talking about determining the web root of a remote host that you are connecting to using FTP, the answer is no, definitely not.
The FTP account you are using to log on can have a root setting completely different from what Virtual host(s) are configured on the server. They have nothing to do with each other, and no way to interact.
There will usually be some overlap (e.g. the FTP directory being something like
/htdocs/domain.com/but there is no pattern you could rely on.