@@ -2,7 +2,7 @@ Name: libURLMultipartFormAddPart
22
33Type: function
44
5- Syntax: libURLMultipartFormAddPart(<form data >,<part name >, <value> [,<MIME type >, <encoding>])
5+ Syntax: libURLMultipartFormAddPart(<formData >,<partName >, <value> [,<MIMEtype >, <encoding>])
66
77Summary:
88This function lets you add parts to a multipart form one at a time. It
@@ -22,10 +22,11 @@ Security: network
2222
2323Example:
2424command UploadFileToServer pName, pMessage, pFilename
25+ local tOrigHeaders, tForm, tError, tFile, tType, tEnc, tURL
2526 put the httpHeaders into tOrigHeaders
2627 put empty into tForm
2728 put libURLMultipartFormData (tForm, "name", pName, "message", pMessage) into tError
28-
29+
2930 if tError is empty then
3031 set the httpHeaders to line 1 of tForm
3132 delete line 1 of tForm
@@ -34,14 +35,14 @@ command UploadFileToServer pName, pMessage, pFilename
3435 put "binary" into tEnc
3536 put libURLMultipartFormAddPart(tForm,"file", tFile, tType, tEnc) into tError
3637 end if
37-
38+
3839 if tError is empty then
3940 post tForm to url tURL
4041 put the result into tError
4142 end if
42-
43+
4344 set the httpHeaders to tOrigHeaders
44-
45+
4546 if tError is not empty then
4647 return tError for error
4748 else
@@ -50,24 +51,28 @@ command UploadFileToServer pName, pMessage, pFilename
5051end UploadFileToServer
5152
5253Parameters:
53- value:
54+ formData(string): A variable, which will be filled with the form data.
5455
56+ partName(string): The name of the new part to add to the <formData>.
5557
56- encoding:
58+ value(string): The value to be associated with the <partName> of the <formData>.
59+
60+ MIMEtype(enum): The MIME type to use for the <value>.
61+
62+ encoding(enum): The encoding type to use for the <value>.
5763
5864
5965Description:
6066This function is mainly used if you have called the
6167<libURLMultipartFormData> with no arguments except the form data. This
6268will return an "empty" form which can be added to using this function.
6369
64- >*Important:* The <libURLMultipartFormAddPart> <function> is part of
65- > the
66- > <Internet library>. To ensure that the <function> works in a
67- > <standalone application>, you must include this
68- > <LiveCode custom library|custom library> when you create your
69- > <standalone application|standalone>. In the Inclusions pane of the
70- > <Standalone Application Settings> window, make sure the "Internet"
70+ >*Important:* The <libURLMultipartFormAddPart> <function> is part of the
71+ > <Internet library>. To ensure that the <function> works in a
72+ > <standalone application>, you must include this
73+ > <LiveCode custom library|custom library> when you create your
74+ > <standalone application|standalone>. In the Inclusions pane of the
75+ > <Standalone Application Settings> window, make sure the "Internet"
7176> script library is selected.
7277
7378References: post (command), libURLMultipartFormData (function),
@@ -78,4 +83,3 @@ group (glossary), standalone application (glossary), keyword (glossary),
7883function (glossary), application (glossary), Internet library (library),
7984library (library), startup (message), openBackground (message),
8085preOpenStack (message), openStack (message), preOpenCard (message)
81-
0 commit comments