Code Script .co.uk

Home | Scripts | Tutorials | Disclaimer | Sitemap | Contact

   Ftp Upload
 

Reference / Php / Ftp Upload

Upload a file to an FTP server.


$ftp_server = "www.domain.com"; // FTP hostname
$ftp_user_name = "user"; // FTP username
$ftp_user_pass = "pass"; // FTP password
$ftp_path = "/htdocs/backup/"; // FTP path to upload to

$filename = "text.sql";

$conn_id = ftp_connect($ftp_server);

// login with username and password

$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

ftp_pasv ( $conn_id, true );

$upload = ftp_put($conn_id, $ftp_path.$filename, $filename, FTP_BINARY);





Please note that a disclaimer applies to any code on this page.
 
   Actions
  Go Back
  Bookmark
  Print Page


   Menu
 
- Links
- Reference
     - Javascript
     - Mysql
     - Php
          - Calculate Date Yesterday
          - Database Backup
          - Ftp Upload
          - Gzip File
          - List Files In Directory
          - Previous Sql Insert Id
          - Send Email
          - Server Visitor Properties
          - Set Global Get And Post Variables
          - Sql Query Results
     - Standards
- Script Editors
- Tutorials
- Vbscript