FTP PHP Connect To SFPT
#1

Hey guys i transfer d to a server where i only have sfpt. How can i convert the code below to work as such.

Код:
<?php
global $config;
$local_file = "dmap_feed.json";
$server_file = "/home/samp03/scriptfiles/dmap_feed.json";

$ftp_server = "REMOVED"; // Address of FTP server.
$ftp_user_name = "root"; // Username
$ftp_user_pass = "REMOVED"; // Password
#$destination_file = "C:\Documents and Settings\DraKoNSAMP\Desktop\Clan [mGo]\GAMEMODE SAMP\GM\Sourcer\scriptfiles";
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
"File Downloaded $local_file\n";
} else {
"Desculpe.Servidor Esta Desligado\n";
}
$config['api key']='ABQIAAAAs4hWYZkFgUCmji8OXGEWhRSksbxBFPegAttWA_e4E3REnVZ2ahTH-L1GBwSzV3-OuBv0_8-shNpqtQ';
$config['default script'] = 'dmap_feed.json';
$config['allow external'] = true;

?>
Reply
#2

I'm not sure if this would work, but change FTP with sfpt. Might work worth the try.

Good Luck Robert.
Reply
#3

Already, tried. I also tried the "ssh2_connect" but i messed up the script on it i had to restore it.
Reply
#4

Gotta hate when that happens :S
Reply
#5

figured it out what i did is as follows.
Код:
<?php
global $config;
$local_file = "dmap_feed.json";
$connection = ssh2_connect('removed', 22);
ssh2_auth_password($connection, 'username', 'password');

ssh2_scp_recv($connection, '/remotefile', '/local/file');

$config['api key']='ABQIAAAAs4hWYZkFgUCmji8OXGEWhRSksbxBFPegAttWA_e4E3REnVZ2ahTH-L1GBwSzV3-OuBv0_8-shNpqtQ';
$config['default script'] = 'dmap_feed.json';
$config['allow external'] = true;

?>
Reply
#6

Quote:
Originally Posted by Robert_Crawford
Посмотреть сообщение
figured it out what i did is as follows.
Код:
<?php
global $config;
$local_file = "dmap_feed.json";
$connection = ssh2_connect('removed', 22);
ssh2_auth_password($connection, 'username', 'password');

ssh2_scp_recv($connection, '/remotefile', '/local/file');

$config['api key']='ABQIAAAAs4hWYZkFgUCmji8OXGEWhRSksbxBFPegAttWA_e4E3REnVZ2ahTH-L1GBwSzV3-OuBv0_8-shNpqtQ';
$config['default script'] = 'dmap_feed.json';
$config['allow external'] = true;

?>
Cheers
Reply
#7

If you could define the port with the first script, you could have just changed it to 22.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)