@@ -35,25 +35,26 @@ If an error occurs during transfer of the data, the error is placed in
3535the result <function>. The first <word> returned by the <result>
3636<function> is "error", followed (where appropriate) by the text of the
3737error message returned by the FTP <server>, including the server
38- response code. >*Important:* If a <blocking> operation involving a <URL>
39- (using the <put> <command> to <upload> a <URL>, the <post> <command>,
40- the <delete URL> <command>, or a <statement> that gets an <ftp> or
41- <http> <URL>) is going on, no other <blocking> <URL> operation can start
42- until the previous one is finished. If you attempt to use a <URL> in an
43- <expression>, or put data into a <URL>, while another <blocking> <URL>
44- operation is in progress, the <result> is set to
45- "Error Previous request not completed". Downloading a URL does not
46- prevent other messages from being sent during the download: the current
47- handler is blocked during the download, but other handlers are not. This
48- means that if, for example, your application has a button that downloads
49- a URL, the user might click the button again (or click another <button>
50- that <download|downloads> another <URL>) while the first <URL> is still
51- being <download|downloaded>. In this case, the second <download> is not
52- performed and the <result> is set to
53- "Error Previous request not completed." To avoid this problem, you can
54- set a <flag> while a URL is being <download|downloaded>, and check that
55- <flag> when trying to <download> <URL|URLs> to make sure that there is
56- not already a current <download> in progress.
38+ response code.
39+ > *Important:* If a <blocking> operation involving a <URL>
40+ > (using the <put> <command> to <upload> a <URL>, the <post> <command>,
41+ > the <delete URL> <command>, or a <statement> that gets an <ftp> or
42+ > <http> <URL>) is going on, no other <blocking> <URL> operation can start
43+ > until the previous one is finished. If you attempt to use a <URL> in an
44+ > <expression>, or put data into a <URL>, while another <blocking> <URL>
45+ > operation is in progress, the <result> is set to
46+ > "Error Previous request not completed". Downloading a URL does not
47+ > prevent other messages from being sent during the download: the current
48+ > handler is blocked during the download, but other handlers are not. This
49+ > means that if, for example, your application has a button that downloads
50+ > a URL, the user might click the button again (or click another <button>
51+ > that <download|downloads> another <URL>) while the first <URL> is still
52+ > being <download|downloaded>. In this case, the second <download> is not
53+ > performed and the <result> is set to
54+ > "Error Previous request not completed." To avoid this problem, you can
55+ > set a <flag> while a URL is being <download|downloaded>, and check that
56+ > <flag> when trying to <download> <URL|URLs> to make sure that there is
57+ > not already a current <download> in progress.
5758
5859Description:
5960Use the <ftp> <keyword> to upload or download <files> to or from an
@@ -62,13 +63,13 @@ Internet site.
6263The URL scheme "ftp" indicates information located on an FTP server. An
6364<ftp> <URL> consists of the following parts:
6465
65- 1. The string "ftp://"
66- 2. An optional user name and password, separated by a colon (:)
67- and followed by "@"
68- 3. The name of the server
69- 4. An optional port number preceded by a colon (:)
70- 5. The name and location of a file or directory, starting with a
71- slash (/)
66+ 1. The string "ftp://"
67+ 2. An optional user name and password, separated by a colon (:)
68+ and followed by "@"
69+ 3. The name of the server
70+ 4. An optional port number preceded by a colon (:)
71+ 5. The name and location of a file or directory, starting with a
72+ slash (/)
7273
7374
7475If you don't specify a port number, port 21 is used. (This is the
@@ -90,24 +91,25 @@ standard port for FTP.)
9091 put "jim" into userName
9192 put "jsmith@example.org" into userPassword
9293 put "ftp://" & userName & ":" & URLEncode(userPassword) \
93-
94- & "@ftp.example.com/title.txt" into fileURLToGet
95-
94+ & "@ftp.example.com/title.txt" into fileURLToGet
9695 get URL fileURLToGet
9796
9897
9998Here are some examples of valid <ftp> <URL|URLs>:
100- ftp://ftp.example.org/directory/ -- list of files and folders in a
101- directory ftp://ftp.example.org/directory/file.exe -- a file on the
102- server ftp://user:password@ftp.example.org/myfile -- a file accessed by
103- a password ftp://ftp.example.com:3992/somefile -- using a nonstandard
99+ - ftp://ftp.example.org/directory/ -- list of files and folders in a
100+ directory
101+ - ftp://ftp.example.org/directory/file.exe -- a file on the
102+ server
103+ - ftp://user:password@ftp.example.org/myfile -- a file accessed by
104+ a password
105+ - ftp://ftp.example.com:3992/somefile -- using a nonstandard
104106FTP port
105107
106- An <ftp> <URL> is a <container>, and you can use the <expression> URL
107- ftpURL in any statement where any other <container> type is used. When
108- you get the <value> of an <ftp> <URL>, LiveCode <download|downloads> the
109- <URL> from the <server>. (If you have previously <cache|cached> the URL
110- with the <load> <command>, it fetches the <URL> from the <cache>.)
108+ An <ftp> <URL> is a <container>, and you can use the <expression>
109+ `URL ftpURL` in any statement where any other <container> type is used.
110+ When you get the <value> of an <ftp> <URL>, LiveCode <download|downloads>
111+ the <URL> from the <server>. (If you have previously <cache|cached> the
112+ URL with the <load> <command>, it fetches the <URL> from the <cache>.)
111113
112114A URL that ends with a slash (/) designates a directory (rather than a
113115file). An <ftp> <URL> to a <folder|directory> evaluates to a listing of
@@ -135,17 +137,14 @@ concludes. If the user clicks the button again while the download is
135137still going on, the handler simply beeps:
136138
137139 on mouseUp
138-
139- global downloadInProgress
140- if downloadInProgress then
141-
142- beep
143- exit mouseUp
144-
145- end if
146- put true into downloadInProgress -- about to start
147- put URL (field "FTP URL to get") into field "Command Result"
148- put false into downloadInProgress -- finished
140+ global downloadInProgress
141+ if downloadInProgress then
142+ beep
143+ exit mouseUp
144+ end if
145+ put true into downloadInProgress -- about to start
146+ put URL (field "FTP URL to get") into field "Command Result"
147+ put false into downloadInProgress -- finished
149148 end mouseUp
150149
151150
@@ -189,8 +188,7 @@ container (glossary), URL (glossary), server (glossary),
189188keyword (glossary), application (glossary), handler (glossary),
190189word (glossary), expression (glossary), download (glossary),
191190URL (keyword), file (keyword), ftp (keyword), button (keyword),
192- http (keyword), library (library), delete URL (library),
193- libURLSetFTPListCommand (library), Internet library (library),
191+ http (keyword), library (library), Internet library (library),
194192startup (message), openBackground (message), preOpenStack (message),
195193openStack (message), preOpenCard (message)
196194
0 commit comments