This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathdelete-URL.lcdoc
More file actions
113 lines (87 loc) · 4.28 KB
/
delete-URL.lcdoc
File metadata and controls
113 lines (87 loc) · 4.28 KB
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
Name: delete URL
Synonyms: clear url
Type: command
Syntax: delete URL <URLtoDelete>
Summary:
Removes a <file> or <folder|directory> from a <server>, or removes a
<file> from your system.
Associations: internet library
Introduced: 1.1
OS: mac, windows, linux, ios, android, html5
Platforms: desktop, server, mobile
Security: network
Example:
delete URL "ftp://root:secret-word@mars.example.org/deleteable.txt"
Example:
delete URL "ftp://me:mine@ftp.example.net/trash/"
Example:
answer file "Select the file you wish to delete."
put it into tFileToDelete
delete URL ("file:" & tFileToDelete)
Parameters:
URLtoDelete:
The URLtoDelete specifies the name and location of the file or directory
to delete, in the form of a URL.
The result:
If the file or directory is successfully deleted, the result <function>
is set to empty. Otherwise, the <result> <function> returns an error
message.
>*Important:* If a <blocking> operation involving a <URL>
(using the <put> <command> to <upload> a <URL>, the <post> <command>,
the <delete URL> <command>, or a <statement> that gets an <ftp> or
<http> <URL>) is going on, no other <blocking> <URL> operation can start
until the previous one is finished. If you attempt to use a <URL> in an
<expression>, or put data into a <URL>, while another <blocking> <URL>
operation is in progress, the <result> is set to
"Error Previous request not completed".
Description:
Use the <delete URL> <command> to remove a <file>.
You can use a <file> or <binfile> <URL> to delete a <file>, but not a
<folder>. To remove a <folder> from your system, use the <delete folder>
<command>. (You can also use the <delete file> command to delete a
<local file>.)
This command can also be used to remove files and directories your stack
did not create. Of course, a stack should not remove data it didn't
create without obtaining explicit confirmation from the user.
Normally, FTP servers do not allow anonymous users to delete files, for
obvious reasons. This means that while an <ftp> <URL> without a user
name and password is valid, you will almost always need a user name and
password to use the <delete URL> <command>.
>*Note:* When used with an <ftp> or <http> <URL>, the <delete URL>
> <command> is <blocking>: that is, the <handler> pauses until LiveCode
> is finished deleting the <URL>. Since deleting a file from a server
> may take some time due to network lag, the <delete URL> <command> may
> take long enough to be noticeable to the user.
>*Important:* The <delete URL> <command> is part of the
> <Internet library> on desktop platforms. To ensure that the <command>
> works in a desktop <standalone application>, you must include this
> <LiveCode custom library|custom library> when you create your
> <standalone application|standalone>. In the Inclusions pane of the
> <Standalone Application Settings> window, make sure the "Internet"
> script library is selected.
>*Cross-platform note:* On iOS and Android, <delete URL>
> is implemented in the engine. Therefore the <Internet library> is not
> needed to ensure the <command> works in a mobile
> <standalone application>. If included, the <Internet library>
> implementation will be used instead of the engine implementation.
> *Cross-platform note:* The HTML5 engine only supports HTTP and HTTPs
> protocols.
> *Cross-platform note:* URLs fetched by the HTML5 engine from a domain
> other than that of the hosting the page may be blocked by web browsers,
> unless the server hosting the URL sets the "Access-Control-Origin" header
> appropriately.
References: libURLSetFTPStopTime (command), post (command),
delete file (command), delete folder (command),
function (control structure), result (function),
LiveCode custom library (glossary), application (glossary),
standalone application (glossary), statement (glossary),
blocking (glossary),
Standalone Application Settings (glossary), command (glossary),
expression (glossary), main stack (glossary), group (glossary),
local file (glossary), server (glossary),
upload (glossary), folder (glossary), message (glossary),
handler (glossary), binfile (keyword), ftp (keyword), file (keyword),
URL (keyword), http (keyword), put (library), library (library),
Internet library (library), startup (message), openBackground (message),
preOpenStack (message), openStack (message), preOpenCard (message)
Tags: networking