Advertisement
Guest User

Untitled

a guest
May 19th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. fclose($myfile);
  2.  
  3. $conn->close();
  4.  
  5. //Move file to ftp-server
  6. $ftp_server = "ftp.domain.com";
  7. $ftp_username = "username";
  8. $ftp_userpass = "password";
  9. $ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
  10. $login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);
  11. $remote_location = "/public_html/testdir";
  12. $file = "export.csv";
  13.  
  14. // upload file
  15. if (ftp_put($ftp_conn, $remote_location, $file, FTP_ASCII))
  16. {
  17. echo "Successfully uploaded $file.";
  18. }
  19. else
  20. {
  21. echo "Error uploading $file.";
  22. }
  23.  
  24. // close connection
  25. ftp_close($ftp_conn);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement