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

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