How to Transfer Big or Small Files server to server using PHP script


File transfer server to server


Today i will teach you how to How to Transfer Big or Small Files server to server using PHP script, this work is very easy, if you’re new user? no tension, It’s very easy, just you will create new file extension is php, example: download.php

Screenshot_5[Note: Must Be you have enabled show file extensions in your computer, if you don’t know how to do this? then you can see this post. How to Show file extensions in my computer]

then open this file any code editor software, like notepad++  then you can copy below code then save it.

set_time_limit(0); //Unlimited max execution time  
$path = ''; //Path of file where you want to save it on your server
$url = ''; //Url of file on another server
$newfname = $path;
echo 'Starting Download!<br>';
$file = fopen ($url, "rb");
if($file) {
    $newf = fopen ($newfname, "wb");
        while(!feof($file)) {
            fwrite($newf, fread($file, 1024 * 8 ), 1024 * 8 );
            echo '1 MB File Chunk Written!<br>';
if($file) {
if($newf) {
echo 'Finished!';



Now you can see $url = change this link to replace your download link

Then you will upload this file your cPanel>File Managers>public_html location then you will visit your file example: then automatic download stating your file. when your file downloaded complete then you can see your file your public_html location.

Thank you so much.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!