Ftp upload
3 отговора
143 прегледа
Ftp upload
Kakav beshe nachina da uploadna file na drug server chres FTP komadite v PHP?
I know Karate, Kung Fu, and 47 other dangerous words.
I know Karate, Kung Fu, and 47 other dangerous words.
Re: Ftp upload
$ftpcon = ftp_connect('FTP Server Name');
if (ftp_login ( $ftpcon, 'username', 'password')){
printf('FTP Connection established :)
');
ftp_site($ftpcon, 'PUT bla-bla-bla') or die('Error executing ftp command !');
ftp_close($ftpcon); // closes FTP connection
print('Connection closed');
} else print('FTP connection failed :(');
-> bool ftp_site ( resource ftp_stream, string cmd)
ftp_site() sends the command specified by cmd to the FTP server.
SITE commands are not standardized, and vary from server to server.
They are useful for handling such things as file permissions and group membership.
ili vmesto s ftp_site():
-> bool ftp_put ( resource ftp_stream, string remote_file, string local_file, int mode)
ftp_put() stores local_file on the FTP server, as remote_file.
The transfer mode specified must be either FTP_ASCII or FTP_BINARY.
if (ftp_login ( $ftpcon, 'username', 'password')){
printf('FTP Connection established :)
');
ftp_site($ftpcon, 'PUT bla-bla-bla') or die('Error executing ftp command !');
ftp_close($ftpcon); // closes FTP connection
print('Connection closed');
} else print('FTP connection failed :(');
-> bool ftp_site ( resource ftp_stream, string cmd)
ftp_site() sends the command specified by cmd to the FTP server.
SITE commands are not standardized, and vary from server to server.
They are useful for handling such things as file permissions and group membership.
ili vmesto s ftp_site():
-> bool ftp_put ( resource ftp_stream, string remote_file, string local_file, int mode)
ftp_put() stores local_file on the FTP server, as remote_file.
The transfer mode specified must be either FTP_ASCII or FTP_BINARY.