Jump to content

Recommended Posts

Hello

 

I need to transfer a file from my ftp server to remote ftp server.

Here is my code, but it gives error as,

Warning: ftp_put() [function.ftp-put]: Can't open that file: No such file or directory

 

<?php

ob_start();

 

if(!file_exists('storage/glive.sql')) echo "File not found";

//ftp details of sedtination server

$ftp_server="222.22.22.222";

$ftp_user="ferghco";

$ftp_password="*********";

 

$conn_id = ftp_connect($ftp_server);

$login_result = ftp_login($conn_id, $ftp_user, $ftp_password);

 

if((!$conn_id) || (!$login_result))

{

            echo "FTP connection has failed!";

            echo "Attempted to connect to $ftp_server for user $ftp_user";

exit();

  }

 

$upload = ftp_put($conn_id,'/test/glive1.sql', 'storage/glive.sql', FTP_BINARY);

if (!$upload) { echo 'FTP upload failed!'; }

 

ob_end_flush();

?>

 

Can anybody give the solution??????

Link to comment
https://forums.phpfreaks.com/topic/191738-transferring-file-between-ftps/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.