1--TEST--
2Testing ftp_fput basic functionality
3--EXTENSIONS--
4ftp
5pcntl
6--FILE--
7<?php
8require 'server.inc';
9
10$ftp = ftp_connect('127.0.0.1', $port);
11ftp_login($ftp, 'user', 'pass');
12$ftp or die("Couldn't connect to the server");
13
14$filename = "large_file.txt";
15$filepath = __DIR__ . "/" . $filename;
16
17// Test on boundary of 2 buffers
18for ($i = 4094; $i < 4098; $i++) {
19    $contents = str_repeat("a", $i) . "\n" . str_repeat("b", 10);
20    file_put_contents($filepath, $contents);
21    var_dump(ftp_put($ftp, "large_file.txt", $filepath, FTP_ASCII));
22}
23
24?>
25--CLEAN--
26<?php
27@unlink(__DIR__ . "/large_file.txt");
28?>
29--EXPECT--
30bool(true)
31bool(true)
32bool(true)
33bool(true)
34