php - How to upload file to FTP using cron jobs -
i want able upload csv file once day (locally pc) ftp. going insert csv file mysql table.
i've created cron job pick csv , insert database, i'm struggling how figure out how pick file on loacl pc , upload ftp.
has got ideas?
thanks adi
you can using ftp extension in php, like:
$conn = ftp_connect("destination.host", 21) or die("failed connect"); ftp_login($conn, $user, $pass) or die("failed login"); ftp_put($conn, "/path/on/ftp/server", "/path/on/your/local", ftp_binary) or die("failed upload);
more details: http://us2.php.net/manual/en/book.ftp.php
Comments
Post a Comment