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>
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
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>startpos</parameter><initializer>0</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,7 +72,7 @@
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>
80
78

...
...
@@ -89,6 +87,7 @@
89
87
</row>
90
88
</thead>
91
89
<tbody>
90
+
&ftp.changelog.ftp-param;
92
91
<row>
93
92
<entry>7.3.0</entry>
94
93
<entry>
...
...
@@ -111,14 +110,14 @@
111
110
<?php
112
111

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

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

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

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

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

174
172
<!-- Keep this comment at the end of the file
175
173
Local variables:
176
174
mode: sgml
177
175