Name: libURLMultipartFormAddPart

Type: function

Syntax: libURLMultipartFormAddPart(<form data>,<part name>, <value> [,<MIME type>, <encoding>])

Summary: This function lets you add parts to a multipart form one at a time. It also lets you optionally specify the mime type and transfer encoding for each part. This can be useful where the mime type or transfer encoding has to be specified.

Introduced: 2.5

OS: mac,windows,linux

Platforms: desktop,server,web

Security: network

Example:
put empty into tForm
put "dave" into tName
put "hello" into tMessage
if libURLMultipartFormData (tForm, "name", tName, "message", tMessage)\
     is not empty then
   ##handle error and exit
end if
set the httpHeaders to line 1 of tForm
delete line 1 of tForm
put "&lt;file&gt;" & "C:/myfile.gif" into tFile
put "image/gif" into tType
put "binary" into tEnc
if libURLMultipartFormAddPart(tForm,"file", tFile, tType, tEnc)\
      empty then
   ##handle error and exit
else
   post  tForm to url 
   set the httpHeaders to empty
end if

Parameters:
value: 
encoding: 

Description:
This function is mainly used if you have called the <libURLMultipartFormData> with no arguments except the form data. This will return an "empty" form which can be added to using this function.

>*Important:*  The <libURLMultipartFormAddPart> <function> is part of the <Internet library>. To ensure that the <keyword> works in a <standalone application>, you must include this <Revolution custom library|custom library> when you create your <standalone application|standalone>. In the Inclusions section of the <Standalone Application Settings> window, make sure "Internet Library" is selected in the list of script libraries.

>*Note:* When included in a <standalone application>, the <Internet library> is implemented as a hidden <group> and made available when the <group> receives its first <openBackground> message. During the first part of the <application|application's> startup process, before this <message> is sent, the http <keyword> is not yet available. This may affect attempts to use this <keyword> in <startup>, <preOpenStack>, <openStack>, or <preOpenCard> <handler|handlers> in the <main stack>. Once the <application> has finished starting up, the <library> is available and the http <keyword> can be used in any <handler>.

References: startup (message), openBackground (message), preOpenStack (message), openStack (message), preOpenCard (message), post (command), libURLMultipartFormData (function), libURLFormData (function), Internet library (library), Revolution custom library (library), library (library), main stack (glossary), handler (glossary), Standalone Application Settings (glossary), message (glossary), group (glossary), standalone application (glossary), keyword (glossary), function (glossary), application (glossary)
