Annotation of embedaddon/php/ext/ftp/tests/bug39583-2.phpt, revision 1.1.1.1

1.1       misho       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: require 'server.inc';
                     10: 
                     11: $ftp = ftp_connect('127.0.0.1', $port);
                     12: if (!$ftp) die("Couldn't connect to the server");
                     13: 
                     14: var_dump(ftp_login($ftp, 'user', 'pass'));
                     15: 
                     16: $source_file = __FILE__;
                     17: $destination_file = basename(__FILE__);
                     18: 
                     19: // upload the file
                     20: $upload = ftp_put($ftp, $destination_file, $source_file, FTP_BINARY);
                     21: 
                     22: // check upload status
                     23: if (!$upload) {
                     24:        echo "FTP upload has failed!";
                     25:    } else {
                     26:        echo "Uploaded $source_file as $destination_file";
                     27:    }
                     28: 
                     29: // close the FTP stream
                     30: ftp_close($ftp);
                     31: ?>
                     32: --EXPECTF--
                     33: bool(true)
                     34: Uploaded %sbug39583-2.php as bug39583-2.php

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>