FTP Upload File
Need to transfer files via FTP in some automated or scheduled manner. It is actually quite easy to do using FTP. Following is a simplistic PHP FTP example to get you started.
Replace 'hostname', 'username', and 'password' with real FTP credentials, then we try and connect to the FTP server.
$connect = ftp_connect('hostname');
$login = ftp_login($connect, 'username', 'password');
if an error occurred connecting to the FTP server, then we can stop here:
Otherwise let's proceed and upload a file via FTP. Be sure to replace '/path/to/file.ext' with the full path to your file, as well as 'file.ext' with the filename you would like to use when you FTP up the file.
and finally let's perform a simple check to see if the file was uploaded successfully.
You’re currently reading “ FTP Upload File ,” an entry on BRADINO
- Published:
- 12.8.08 / 3pm
- Category:
- PHP























Thanks, I have been looking for an up to date php site, like phpclasses.org and this site looks promising. Keep up the good work.