0

In PHP I used ftp_put to upload a file.

  • How can I get path of file including hosting username, for example: /home/username/public_html/website/file.php
  • How can I get url of file, for example: http://example.com/website/file.php

I have searched a lot but can find.

Thank for help!

Smart Cms
  • 13
  • 1
  • 5
  • You can try [`ftp_pwd()`](http://php.net/manual/function.ftp-pwd.php) to get the current directory but I don't think there's any guarantee that it will contain the absolute path. For your other question, there's absolutely nothing you can query to link an FTP folder with an HTTP accessible path without any prior knowledge – Phil Apr 05 '18 at 04:26
  • @Phil Yes ftp_pwd do not including /home/username – Smart Cms Apr 05 '18 at 04:30

0 Answers0