Advertisement
wzline

FTP test

Jun 7th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. // Set up a connection
  2. try {
  3.     $conn = ftp_ssl_connect('ftps', '2122', 5);
  4.     if (ftp_login($conn, '', ''))
  5.     {
  6.         //ftp_pasv($conn, true);
  7.         ftp_chdir($conn, '/1C-Boo.ua');
  8.         $file = $_SERVER['DOCUMENT_ROOT'].'/upload/007.txt';
  9.         if (file_exists($file))
  10.         {
  11.             $files = ftp_put($conn, $_SERVER['DOCUMENT_ROOT'].'/upload/007.txt', '/1C-Boo.ua/007.txt', FTP_BINARY);
  12.             var_dump($files);
  13.         }
  14.     }
  15.     ftp_close($conn);
  16.     print_r(error_get_last());
  17. } catch (\Exception $e) {
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement