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>
15
-
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
16
-
<methodparam choice="opt"><type>int</type><parameter>startpos</parameter><initializer>0</initializer></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
+
<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_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>
...
...
@@ -71,6 +69,31 @@
71
69
&return.success;
72
70
</para>
73
71
</refsect1>
72
+

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

74
97
<refsect1 role="examples">
75
98
&reftitle.examples;
76
99
<para>
...
...
@@ -83,20 +106,20 @@ $file = 'somefile.txt';
83
106
$remote_file = 'readme.txt';
84
107

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

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

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

98
121
// close the connection
99
-
ftp_close($conn_id);
122
+
ftp_close($ftp);
100
123
?>
101
124
]]>
102
125
</programlisting>
...
...
@@ -115,7 +138,6 @@ ftp_close($conn_id);
115
138
</para>
116
139
</refsect1>
117
140
</refentry>
118
-

119
141
<!-- Keep this comment at the end of the file
120
142
Local variables:
121
143
mode: sgml
122
144