bug39583.phpt 701 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Bug #39583 (FTP always transfers in binary mode)
  3. --SKIPIF--
  4. <?php
  5. require 'skipif.inc';
  6. ?>
  7. --FILE--
  8. <?php
  9. $bug39583=1;
  10. require 'server.inc';
  11. $ftp = ftp_connect('127.0.0.1', $port);
  12. if (!$ftp) die("Couldn't connect to the server");
  13. var_dump(ftp_login($ftp, 'user', 'pass'));
  14. $source_file = __FILE__;
  15. $destination_file = basename(__FILE__);
  16. // upload the file
  17. $upload = ftp_put($ftp, $destination_file, $source_file, FTP_ASCII);
  18. // check upload status
  19. if (!$upload) {
  20. echo "FTP upload has failed!";
  21. } else {
  22. echo "Uploaded $source_file as $destination_file";
  23. }
  24. // close the FTP stream
  25. ftp_close($ftp);
  26. ?>
  27. --EXPECTF--
  28. bool(true)
  29. Uploaded %sbug39583.php as bug39583.php