Answer the question
In order to leave comments, you need to log in
How to get the path from the root of the user having only an ftp connection to the server?
Here is such a simple question, I need to upload a file via ftp from a script to a folder on the domain.com/images/ server,
as if everything is simple
ftp_put($connect, $destination, $source, FTP_BINARY))
Answer the question
In order to leave comments, you need to log in
In general, no way, because it depends on the configuration of the ftp daemon: many chroot into the user's home folder, and some even virtualize the paths. Typically, scripts that update via FTP (the same phpbb) request a prefix for the FTP path to www-root from the user.
In a particular case, when ftp-access comes from the root FS, and PHP also works without cheats and other restrictions - we get the full path to the file through realpath() and give it to FTP.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question