reference/ftp/functions/ftp-nb-put.xml
4d1c34c9b7a30cfc3a59641122c707a2812cfed7
...
...
@@ -8,12 +8,12 @@
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
-
<type>int</type><methodname>ftp_nb_put</methodname>
12
-
<methodparam><type>resource</type><parameter>ftp_stream</parameter></methodparam>
13
-
<methodparam><type>string</type><parameter>remote_file</parameter></methodparam>
14
-
<methodparam><type>string</type><parameter>local_file</parameter></methodparam>
15
-
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
16
-
<methodparam choice="opt"><type>int</type><parameter>startpos</parameter><initializer>0</initializer></methodparam>
11
+
<type class="union"><type>int</type><type>false</type></type><methodname>ftp_nb_put</methodname>
12
+
<methodparam><type>FTP\Connection</type><parameter>ftp</parameter></methodparam>
13
+
<methodparam><type>string</type><parameter>remote_filename</parameter></methodparam>
14
+
<methodparam><type>string</type><parameter>local_filename</parameter></methodparam>
15
+
<methodparam choice="opt"><type>int</type><parameter>mode</parameter><initializer><constant>FTP_BINARY</constant></initializer></methodparam>
16
+
<methodparam choice="opt"><type>int</type><parameter>offset</parameter><initializer>0</initializer></methodparam>
17
17
</methodsynopsis>
18
18
<para>
19
19
<function>ftp_nb_put</function> stores a local file on the FTP server.
...
...
@@ -29,15 +29,13 @@
29
29
<para>
30
30
<variablelist>
31
31
<varlistentry>
32
-
<term><parameter>ftp_stream</parameter></term>
32
+
<term><parameter>ftp</parameter></term>
33
33
<listitem>
34
-
<para>
35
-
The link identifier of the FTP connection.
36
-
</para>
34
+
&ftp.parameter.ftp;
37
35
</listitem>
38
36
</varlistentry>
39
37
<varlistentry>
40
-
<term><parameter>remote_file</parameter></term>
38
+
<term><parameter>remote_filename</parameter></term>
41
39
<listitem>
42
40
<para>
43
41
The remote file path.
...
...
@@ -45,7 +43,7 @@
45
43
</listitem>
46
44
</varlistentry>
47
45
<varlistentry>
48
-
<term><parameter>local_file</parameter></term>
46
+
<term><parameter>local_filename</parameter></term>
49
47
<listitem>
50
48
<para>
51
49
The local file path.
...
...
@@ -62,7 +60,7 @@
62
60
</listitem>
63
61
</varlistentry>
64
62
<varlistentry>
65
-
<term><parameter>startpos</parameter></term>
63
+
<term><parameter>offset</parameter></term>
66
64
<listitem>
67
65
<para>The position in the remote file to start uploading to.</para>
68
66
</listitem>
...
...
@@ -74,9 +72,34 @@
74
72
&reftitle.returnvalues;
75
73
<para>
76
74
Returns <constant>FTP_FAILED</constant> or <constant>FTP_FINISHED</constant>
77
-
or <constant>FTP_MOREDATA</constant>.
75
+
or <constant>FTP_MOREDATA</constant>, or &false; on failure to open the local file.
78
76
</para>
79
77
</refsect1>
78
+

79
+
<refsect1 role="changelog">
80
+
&reftitle.changelog;
81
+
<informaltable>
82
+
<tgroup cols="2">
83
+
<thead>
84
+
<row>
85
+
<entry>&Version;</entry>
86
+
<entry>&Description;</entry>
87
+
</row>
88
+
</thead>
89
+
<tbody>
90
+
&ftp.changelog.ftp-param;
91
+
<row>
92
+
<entry>7.3.0</entry>
93
+
<entry>
94
+
The <parameter>mode</parameter> parameter is now optional. Formerly it
95
+
has been mandatory.
96
+
</entry>
97
+
</row>
98
+
</tbody>
99
+
</tgroup>
100
+
</informaltable>
101
+
</refsect1>
102
+

80
103
<refsect1 role="examples">
81
104
&reftitle.examples;
82
105
<para>
...
...
@@ -87,14 +110,14 @@
87
110
<?php
88
111

89
112
// Initiate the Upload
90
-
$ret = ftp_nb_put($my_connection, "test.remote", "test.local", FTP_BINARY);
113
+
$ret = ftp_nb_put($ftp, "test.remote", "test.local", FTP_BINARY);
91
114
while ($ret == FTP_MOREDATA) {
92
115
93
116
// Do whatever you want
94
117
echo ".";
95
118

96
119
// Continue uploading...
97
-
$ret = ftp_nb_continue($my_connection);
120
+
$ret = ftp_nb_continue($ftp);
98
121
}
99
122
if ($ret != FTP_FINISHED) {
100
123
echo "There was an error uploading the file...";
...
...
@@ -111,9 +134,9 @@ if ($ret != FTP_FINISHED) {
111
134
<?php
112
135

113
136
// Initiate
114
-
$ret = ftp_nb_put($my_connection, "test.remote", "test.local",
137
+
$ret = ftp_nb_put($ftp, "test.remote", "test.local",
115
138
FTP_BINARY, ftp_size("test.remote"));
116
-
// OR: $ret = ftp_nb_put($my_connection, "test.remote", "test.local",
139
+
// OR: $ret = ftp_nb_put($ftp, "test.remote", "test.local",
117
140
// FTP_BINARY, FTP_AUTORESUME);
118
141

119
142
while ($ret == FTP_MOREDATA) {
...
...
@@ -122,7 +145,7 @@ while ($ret == FTP_MOREDATA) {
122
145
echo ".";
123
146

124
147
// Continue uploading...
125
-
$ret = ftp_nb_continue($my_connection);
148
+
$ret = ftp_nb_continue($ftp);
126
149
}
127
150
if ($ret != FTP_FINISHED) {
128
151
echo "There was an error uploading the file...";
...
...
@@ -146,7 +169,6 @@ if ($ret != FTP_FINISHED) {
146
169
</para>
147
170
</refsect1>
148
171
</refentry>
149
-

150
172
<!-- Keep this comment at the end of the file
151
173
Local variables:
152
174
mode: sgml
153
175