reference/ftp/functions/ftp-put.xml
4d1c34c9b7a30cfc3a59641122c707a2812cfed7
...
...
@@ -9,11 +9,11 @@
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
11
<type>bool</type><methodname>ftp_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>
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_put</function> stores a local file on the FTP server.
...
...
@@ -24,15 +24,13 @@
24
24
<para>
25
25
<variablelist>
26
26
<varlistentry>
27
-
<term><parameter>ftp_stream</parameter></term>
27
+
<term><parameter>ftp</parameter></term>
28
28
<listitem>
29
-
<para>
30
-
The link identifier of the FTP connection.
31
-
</para>
29
+
&ftp.parameter.ftp;
32
30
</listitem>
33
31
</varlistentry>
34
32
<varlistentry>
35
-
<term><parameter>remote_file</parameter></term>
33
+
<term><parameter>remote_filename</parameter></term>
36
34
<listitem>
37
35
<para>
38
36
The remote file path.
...
...
@@ -40,7 +38,7 @@
40
38
</listitem>
41
39
</varlistentry>
42
40
<varlistentry>
43
-
<term><parameter>local_file</parameter></term>
41
+
<term><parameter>local_filename</parameter></term>
44
42
<listitem>
45
43
<para>
46
44
The local file path.
...
...
@@ -57,7 +55,7 @@
57
55
</listitem>
58
56
</varlistentry>
59
57
<varlistentry>
60
-
<term><parameter>startpos</parameter></term>
58
+
<term><parameter>offset</parameter></term>
61
59
<listitem>
62
60
<para>The position in the remote file to start uploading to.</para>
63
61
</listitem>
...
...
@@ -83,6 +81,7 @@
83
81
</row>
84
82
</thead>
85
83
<tbody>
84
+
&ftp.changelog.ftp-param;
86
85
<row>
87
86
<entry>7.3.0</entry>
88
87
<entry>
...
...
@@ -107,20 +106,20 @@ $file = 'somefile.txt';
107
106
$remote_file = 'readme.txt';
108
107

109
108
// set up basic connection
110
-
$conn_id = ftp_connect($ftp_server);
109
+
$ftp = ftp_connect($ftp_server);
111
110

112
111
// login with username and password
113
-
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
112
+
$login_result = ftp_login($ftp, $ftp_user_name, $ftp_user_pass);
114
113

115
114
// upload a file
116
-
if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) {
115
+
if (ftp_put($ftp, $remote_file, $file, FTP_ASCII)) {
117
116
echo "successfully uploaded $file\n";
118
117
} else {
119
118
echo "There was a problem while uploading $file\n";
120
119
}
121
120

122
121
// close the connection
123
-
ftp_close($conn_id);
122
+
ftp_close($ftp);
124
123
?>
125
124
]]>
126
125
</programlisting>
...
...
@@ -139,7 +138,6 @@ ftp_close($conn_id);
139
138
</para>
140
139
</refsect1>
141
140
</refentry>
142
-

143
141
<!-- Keep this comment at the end of the file
144
142
Local variables:
145
143
mode: sgml
146
144