forked from samyeyo/LuaRT-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFtp-upload.html
259 lines (253 loc) · 10.9 KB
/
Ftp-upload.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta content="IE=edge" http-equiv="X-UA-Compatible" />
<meta content="width=device-width, initial-scale=1" name="viewport" />
<meta name="description" content="uploading file on FTP server" />
<title>
Ftp.upload() | LuaRT free and open source Windows programming framework for Lua
</title>
<link href="../../css/bulma-docs.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css"
rel="stylesheet" />
<link href="https://luart.org/doc/net/Ftp-upload.html" rel="canonical" />
<link href="../../img/favicon.png" rel="icon" sizes="16x16" type="image/png" />
<link rel="stylesheet" href="../prism.css" data-noprefix="">
</head>
<body class="layout-documentation has-navbar-fixed-top">
<nav class="bd-navbar navbar is-fixed-top has-shadow" id="navbar">
<div class="navbar-brand">
<a class="navbar-item" href="../../index.html">
<img alt="LuaRT: Free and open source Windows programming framework for Lua"
height="40"
src="../../img/logo.svg"
width="112" />
</a>
<a class="navbar-item bd-navbar-mobile-icon"
href="https://github.com/samyeyo"
style="margin-left: auto"
target="_blank">
<span class="icon" style="color: #000000">
<i class="fab fa-lg fa-github"></i>
</span>
</a>
<a class="navbar-item bd-navbar-mobile-icon"
href="https://twitter.com/__LuaRT__"
target="_blank">
<span class="icon" style="color: #000000">
<i class="fab fa-lg fa-x-twitter"></i>
</span>
</a>
<a class="navbar-item bd-navbar-mobile-icon"
href="https://www.youtube.com/channel/UCS4DTQ3-6xKmkVrFr8Xxc7Q"
target="_blank">
<span class="icon" style="color: #FF0000">
<i class="fab fa-lg fa-youtube"></i>
</span>
</a><a class="navbar-item bd-navbar-mobile-icon"
href="https://discord.gg/cvQV77nhfr"
target="_blank">
<span class="icon" style="color: #5865F2">
<i class="fab fa-discord"></i>
</span>
</a>
<button class="navbar-burger burger"
data-target="navMenuDocumentation"
id="navbarBurger">
<span></span>
<span></span>
<span></span>
</button>
</div>
<div class="navbar-menu" id="navMenuDocumentation">
<div class="navbar-start bd-navbar-start bd-is-original"
id="navbarStartOriginal">
<a class="navbar-item bd-navbar-item bd-navbar-item-bulma-book bd-navbar-item-base"
href="../../index.html#section_features">
<span class="icon has-text-bleeding">
<i class="fas fa-certificate"></i>
</span>
<span>Features</span>
</a>
<a class="navbar-item bd-navbar-item bd-navbar-item-love bd-navbar-item-base"
href="../../index.html#section_download">
<span class="icon has-text-danger">
<i class="fas fa-download"></i>
</span>
<span>Download</span>
</a>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-item bd-navbar-item bd-navbar-item-videos bd-navbar-item-base scroll">
<span class="icon has-text-success"><i class="fas fa-circle-play"></i></span><span>Getting started</span>
</a>
<div class="navbar-dropdown has-background-success-light">
<a href="../install.html" class="dropdown-item has-text-success-dark">
<span class="icon"><i class="fa fa-computer"></i></span> Installation
</a>
<a href="../first.html" class="dropdown-item has-text-success-dark">
<span class="icon"><i class="fa fa-play"></i></span> First execution
</a>
<a href="../tour.html" class="dropdown-item has-text-success-dark">
<span class="icon"><i class="fa fa-bus-simple"></i></span> Take a tour !
</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-item bd-navbar-item bd-navbar-item-extensions bd-navbar-item-base scroll">
<span class="icon has-text-info"><i class="fas fa-book"></i></span><span>Documentation</span>
</a>
<div class="navbar-dropdown has-background-info-light">
<a href="../modules.html" class="dropdown-item has-text-info-dark">
<span class="icon"><i class="fa fa-cubes"></i></span> Modules reference
</a>
<a href="../object.html" class="dropdown-item has-text-info-dark">
<span class="icon"><i class="fa fa-shapes"></i></span> Object oriented programming
</a>
<a href="../toolchain.html" class="dropdown-item has-text-info-dark">
<span class="icon"><i class="fa fa-wrench"></i></span> Toolchain documentation
</a>
</div>
</div>
</a>
<a class="navbar-item bd-navbar-item bd-navbar-item-expo bd-navbar-item-base"
href="https://community.luart.org">
<span class="icon has-text-warning">
<i class="fas fa-comments"></i>
</span>
<span>Community</span>
</a>
<a class="navbar-item bd-navbar-item bd-navbar-item-blog bd-navbar-item-base"
href="https://luart.org/doc/tutorial/index.html">
<span class="icon has-text-rss">
<i class="fas fa-graduation-cap"></i>
</span>
<span>Tutorials</span>
</a>
<div class="ml-6">
<span class="icon has-text-grey-light mr-1">
<i class="fas fa-search"></i>
</span></div>
<script async src="https://cse.google.com/cse.js?cx=509c4cdde27f845e7"></script>
<div class="gcse-searchbox-only" data-resultsUrl="https://luart.org/search.html"></div>
</div>
</div>
<div class="navbar-end">
<a class="bd-navbar-icon navbar-item"
href="https://github.com/samyeyo"
target="_blank">
<span class="icon" style="color: #000000">
<i class="fab fa-lg fa-github"></i>
</span>
</a>
<a class="bd-navbar-icon navbar-item"
href="https://twitter.com/__LuaRT__"
target="_blank">
<span class="icon" style="color: #000000">
<i class="fab fa-lg fa-x-twitter"></i>
</span>
</a>
<a class="bd-navbar-icon navbar-item"
href="https://www.youtube.com/channel/UCS4DTQ3-6xKmkVrFr8Xxc7Q"
target="_blank">
<span class="icon" style="color: #FF0000">
<i class="fab fa-lg fa-youtube"></i>
</span>
</a>
<a class="bd-navbar-icon navbar-item"
href="https://discord.gg/cvQV77nhfr"
target="_blank">
<span class="icon" style="color: #5865F2">
<i class="fab fa-lg fa-discord"></i>
</span>
</a>
</div>
</nav>
<section class="main-content columns is-centered is-fullheight" style="margin-top: 6%; margin-bottom: 4%">
<div class="column is-7">
<div class="card">
<a class="button is-white pl-5" href="Ftp.html?methods"><span class="icon has-text-grey-lighter"><i class="fas fa-circle-left"></i></span></a>
<div class="card-content pt-0">
<div class="content">
<p class="has-text-weight-light is-size-3 mb-5" style="color: #004080; vertical-align: middle">Ftp:upload(<span>file</span>, <span style="color:#EA6AC3">[remote_name]</span>)</p>
<p><br>
Upload a file to the connected FTP server.</p>
<p class="is-size-4 mb-1 mt-6" style="color: #004080">Parameters</p>
<p class="has-text-weight-light is-size-5 mt-2 mb-0"><span>file</span></p>
<p>A <span style="color:#EA6AC3">string</span> or a <a href="../sys/File.html"><i class="fas fa-file" style="color :#367DBB"></i> File</a> object representing the file to be uploaded to the server.</p>
<p class="has-text-weight-light is-size-5 mt-2 mb-0"><span style="color:#EA6AC3">[remote_name]</span></p>
<p>An optional string that contains the destination path and filename on the server.<br>If not provided, the file will be uploaded on the current FTP directory (See <a href="./Ftp-currentdir.html">Ftp.currentdir</a>) using the same filename.</p>
<p class="is-size-4 mb-1 mt-6" style="color: #004080">Return value</p>
<br>Returns <span style="color:#ae81ff">true</span> if uploading to the FTP server was successful, or <span style="color:#ae81ff">false</span> otherwise.
<br>This method return a <a href="../sys/Task.html"><i class="fas fa-bolt" style="font-size:1em; color :#367DBB"></i> Task</a> instance. Once the Task has finished, it will return a <code>boolean</code> value indicating if the operation was successful.
<p class="is-size-4 mt-6 mb-0" style="color: #004080">Example</p>
<div class="language-lua mr-6 ml-6"><code>
local net = require "net"
-- connect to the FTP server
local url = "your ftp server"
local client = net.Ftp(url, "username", "password")
-- upload file "test.txt"
if await(client:upload(File("test.txt"))) then
print("Successfully uploaded 'test.txt' to "..url)
else
error(net.error)
end
</code></div>
</div>
</div>
</div>
</div>
</section>
<footer class="footer">
<div class="content has-text-centered">
<p class="mb-0">
<strong>
Lua
<sup>rt</sup> Documentation
</strong> - Windows programming framework for Lua
</p>
<a class="is-hovered" href="https://github.com/samyeyo" target="_blank">
<span class="icon" style="color: #A0A0A0">
<i class="fab fa-lg fa-github"></i>
</span>
</a>
<a class="is-hovered"
href="https://twitter.com/__LuaRT__"
target="_blank">
<span class="icon" style="color: #A0A0A0">
<i class="fab fa-lg fa-x-twitter"></i>
</span>
</a>
<a class="is-hovered"
href="https://www.youtube.com/channel/UCS4DTQ3-6xKmkVrFr8Xxc7Q"
target="_blank">
<span class="icon" style="color: #A0A0A0">
<i class="fab fa-lg fa-youtube"></i>
</span>
</a>
<a class="is-hovered"
href="https://discord.gg/cvQV77nhfr"
target="_blank">
<span class="icon" style="color: #A0A0A0">
<i class="fab fa-lg fa-discord"></i>
</span>
</a>
<p class="mt-0">
Copyright © 2024
<a href="mailto:[email protected]">Samir Tine</a>.
<br />
<a href="https://bulma.io/made-with-bulma/">
<img alt="Made with Bulma"
height="24"
src="https://bulma.io/images/made-with-bulma.png"
width="128" />
</a>
</p>
</div>
</footer>
</body>
<script src="../../js/main.js"></script>
<script src="../prism.js"></script>
<script src="../custom-class.js"></script>
<script>Prism.plugins.customClass.prefix('prism--');</script>
</html>