Fandom

Livecode Wiki

LibURLMultipartFormAddPart

1,968pages on
this wiki
Add New Page
Comments0 Share

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.

Syntax:

libURLMultipartFormAddPart(form data,part name,value[,MIME type,encoding])

Examples:

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 "<file>" & "C:/myfile.gif" into tFile
put "image/gif" into tType
put "binary" into tEnc
if libURLMultipartFormAddPart(tForm,"file", tFile, tType, tEnc) is empty then
  ##handle error and exit
else
 post  tForm to url 
 set the httpHeaders to empty
end if


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.

See: Internet library

See Also: post Command, libURLMultipartFormData Function, libURLFormData Function

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.