35 C

PHP: How to Transfer File from Server to Server Online using PHP?

Must read

Ayyaz Zafarhttps://www.ayyaztech.com
I am Full Stack Web Developer with 10 years of professional Experience. I have following Skills: HTML5, CSS3, Javascript, jQuery, Ajax, PHP, MySQL, jQuery, Angular, React.js, Wordpress, Codeigniter, Laravel, Node.js, Mongo DB, Express.js, GraphQL, Typescript, Apollo and many more..
// you can increase following limits according to size of remote file.
ini_set('max_execution_time', '30000');
ini_set('memory_limit', '30000');

/* Source File URL */
$remote_file_url = 'http://www.Your_remote_url.com/Your_File.zip';
/* New file name and path for this file */
$local_file = 'Your_File.zip';
/* Copy the file from source url to server */
$copy = copy( $remote_file_url, $local_file );
/* Add notice for success/failure */
if( !$copy ) {
    echo "Copy Failed\n";
    echo " File is successfully copied.\n";


- Advertisement -spot_img

More articles


Please enter your comment!
Please enter your name here

Latest article