Breaking News
You are here : Home / Web development / PHP / Transfer Files between servers Using PHP ftp
Php script For file trasfer between servers

Transfer Files between servers Using PHP ftp

Transfer Files Between Servers Using Php Ftp:

Hello Guys ! Today I’m posting a Php Ftp File Transfer  Script   to Transfer Files between Servers. File Transfer between Servers is not that hard, i can be done using SSH shell access via linux terminal ,But some Times we don’t have SSH shell access for security reasons and incase of shared or personal hosting plans. and situation occurs when we create a project on our server and then we have to transfer it to other server when that project has been completed and we don’t have shell access. So we have to first download it and then Upload it to other server,which is very exhausting and boring if you have low bandwidth.

So I created a PHP Script for Server to server File Transfer  for this functionality ,All we have to do is to Upload it to Server on which we want the File to be downloaded or process can be reverse if  we use php ftp put function rather than Ftp_get.

In this Demonstration I am going to tell you the Ftp_get and i assume that  you can implement the reverse by yourself if needed but both will do same thing so its your choice.

Okay so lets Get started ,See the Script below

PHP Server to Server Trasfer Script( File Trasfer B/w Servers)

The Script is quite small and you can easily under stand it.See the Steps How to use this Script

Steps TO use File Trasfer B/w Servers PHP Scripts

  • Copy The PHP Ftp server File trasfer Script Above.
  • In the PHP Ftp Script Replace the variable values with Your Ftp Target server From which file is to be downloaded eg:Give values to $server=’server address’,$user=’ftp user name’,$pass=’ftgp password’,$file=’path to the file which has to be downloaded ,’$local_file=’path where we wana store the file on the source server where this script will run’
  • Upload this PHP File transfer script to the source server where we want to download the file from another file on location which can be browsed by browser
  • Finally Run this script from browser by typing the address.Eg :

That it We are done ,Check your server for file ,In a second The file will be downloaded to that server to your server.So that was all about Trasnsfer FIles b/w servers Using PHP Ftp.This PHP File Trasfer Between servers Script will make your File transfers between servers easy.

Hope you find this PHP Server to Server FIle Transfer Script Useful.Please like and share If you liked this post.

Thanks For visiting and viewing our Article.


Tags : , ,

3 Replies

  1. Ismael Aliguyon says:

    Hello Ramandep, this is Ismael, Hope you can help me, I am looking for a script and step by step process on how to transfer files between two servers using batch ftp. Please send me email:

  2. sunnex says:

    this tutorial is really tha best i uses it on my site, i recommend this for you guys

Leave a Reply

Want to join the discussion ? Feel Free to contribute !