SHARE
TWEET

Untitled

a guest Jul 20th, 2017 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.     function db_uploadCsv(mysqli $mysql) {
  3.         error_reporting(E_ALL);
  4.         $host = 'ftp.randomsite.com';
  5.         $port = '990';
  6.         $user = 'user';
  7.         $pass = 'pass';
  8.         $src = db_createCsv($mysql);
  9.         $dest = basename($src);
  10.  
  11.         $connId = ftp_ssl_connect($host, $port);
  12.         if ($connId) {
  13.             $login = ftp_login($connId, $user, $pass);
  14.             if ($connId && $login) {
  15.                 $success = ftp_put($connId, $dest, $src, FTP_BINARY);
  16.                 ftp_close($connId);
  17.  
  18.                 return $success;
  19.             } else {
  20.                 ftp_close($connId);
  21.                 return FALSE;
  22.             }  
  23.         }  
  24.         return FALSE;
  25.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top