返回列表 发新帖
查看: 458|回复: 1

[Discuz!二次开发] FTP 类 class_ftp.php 使用说明

[复制链接]

6671

热度

1万

元宝

262

贡献

管理员

DZ专员

发表于 2015-3-5 10:14:49 | 显示全部楼层 |阅读模式
  1. /**
  2. * ----------------------------------------------
  3. * @example  A  object by yourself
  4. * ----------------------------------------------
  5. * $ftp = & discuz_ftp::instance();
  6. * if(!$ftp->connect()) {
  7. *     showmessage('FTP_ERR_'.$ftp->error());
  8. * }
  9. * $ftp->upload('/source/dir/file.name', 'target/dir/file.ext');
  10. * if($ftp->error()) {
  11. *     showmessage('ftp succeed upload');
  12. * } else {
  13. *     showmessage('FTP_ERR_'.$ftp->error());
  14. * }
  15. * $ftp->ftp_close();
  16. * ----------------------------------------------
  17. * @example  B  use function in function_core.php
  18. * ----------------------------------------------
  19. * $succeed = ftpcmd('upload', '/source/file.name');
  20. * if(!$succeed) {
  21. *     showmessage('FTP_ERR_'.ftpcmd('error));
  22. * } else {
  23. *     showmessage('ftp succeed upload');
  24. * }
  25. * ftpcmd('close');
  26. *
  27. */
复制代码


返回列表 发新帖
 懒得打字嘛,点击右侧快捷回复【最新发布】   【赞助草根吧享更多权益】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

收藏帖子 返回列表 搜索

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

小黑屋|手机版|草根吧