Home » » Upload files to remote server

Upload files to remote server

Written By Unknown on Rabu, 15 Juni 2011 | 04.15

To upload files on remote server php built-in function ftp_put() is used.
Just follow these simple steps.

1. Make ftp connection with remote server.
2. Login with remote server username and Password.
3. Use ftp_put() function

The syntax of ftp_put() function :

ftp_put($ftp_conn,$remote_file,$local_file,mode);

Here is the example code :

  //Change this
$server = 'anysite.com';
$username = 'username';
$password = 'password';
$local_file = 'original.jpg';
$remote_file = 'uploaded.jpg';

$conn = ftp_connect($server);
$login = ftp_login($conn, $username, $password);

ftp_put($conn, $remote_file, $local_file, FTP_ASCII);
ftp_close($conn);

Share this article :

Posting Komentar

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Kumpulan Kata Broadcast Blackberry - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger