2011-11-29 06:54
浏览 64


Hi I have a problem in transferring file from server to server I want to copy file like: <-- I want this to copy or upload via ftp to

For example: upload to

How to do this via PHP FTP transferring? Any hardcoder here can help my problem?

图片转代码服务由CSDN问答提供 功能建议

嗨我在将文件从服务器传输到服务器时遇到问题我要复制 文件,如: &lt; - I 希望将其复制或通过ftp上传到

例如: http :// 上传到

如何通过PHP FTP传输执行此操作? 这里的任何硬编码器都可以解决我的问题吗?

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongqu2863 2011-11-29 07:04

    Well here's one sample code, but you should read and try on your own before asking:

    $connection = ftp_connect($server);
    $login = ftp_login($connection, $ftp_user_name, $ftp_user_pass);
    if (!$connection || !$login) { die('Connection attempt failed!'); }
    $upload = ftp_put($connection, $dest, $source, $mode);
    if (!$upload) { echo 'FTP upload failed!'; }

    Hope it helps you getting started

    解决 无用
    打赏 举报

相关推荐 更多相似问题