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

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -