ANTICHAT

ANTICHAT (https://forum.antichat.xyz/index.php)
-   Общие вопросы программирования (https://forum.antichat.xyz/forumdisplay.php?f=206)
-   -   Загрузка файла с поддомена на домен (https://forum.antichat.xyz/showthread.php?t=1469202)

0Z0SK0 25.02.2023 18:47

SFTP

или

PHP:





Код:

$subdomain_host
=
'localhost'
;
$subdomain_user
=
'root'
;
$subdomain_pass
=
'root'
;
$subdomain_path
=
'/home/'
;
$domain_path
=
getcwd
(
)
;
$connection
=
ftp_ssl_connect
(
$subdomain_host
)
;
ftp_login
(
$connection
,
$subdomain_user
,
$subdomain_pass
)
;
ftp_pasv
(
$connection
,
true
)
;
ftp_chdir
(
$connection
,
$subdomain_path
)
;
ftp_put
(
$connection
,
$subdomain_path
.
"filename"
,
$domain_path
.
"/filename"
,
FTP_BINARY
)
;
ftp_close
(
$connection
)
;



Время: 06:50