-
-
Notifications
You must be signed in to change notification settings - Fork 11
libcURL.MultipartForm.AddElement
Andrew Lambert edited this page May 2, 2017
·
30 revisions
libcURL.MultipartForm.AddElement
Function AddElement(Name As String, Value As String) As Boolean
Function AddElement(Name As String, Value As FolderItem, ContentType As String = "") As Boolean
Function AddElement(Name As String, ValueCallbackHandler As libcURL.EasyHandle, ValueSize As Integer, Filename As String = "", ContentType As String = "") As Boolean
Function AddElement(Name As String, ByRef Value As MemoryBlock, Filename As String, ContentType As String = "") As Boolean| Name | Type | Comment |
|---|---|---|
| Name | String | The name of the form element (i.e. the name attribute of the HTML <input> tag) |
| Value | String | The content of the element |
| Name | Type | Comment |
|---|---|---|
| Name | String | The name of the form element (i.e. the name attribute of the HTML <input> tag) |
| Value | FolderItem | A file to encode in the form |
| ContentType | String | Optional. The Content-Type of the file (e.g. text/html.) |
| Name | Type | Comment |
|---|---|---|
| Name | String | The name of the form element (i.e. the name attribute of the HTML <input> tag) |
| ValueCallbackHandler | EasyHandle | The EasyHandle whose DataNeeded event should be raised whenever the form element contents are needed. |
| ValueSize | Integer | The total number of bytes to read via the DataNeeded event. |
| Filename | String | Optional. If specified then the form element is encoded as a file element. |
| ContentType | String | Optional. The Content-Type of the file (e.g. text/html.) This parameter is ignored if Filename is not specified. |
| Name | Type | Comment |
|---|---|---|
| Name | String | The name of the form element (i.e. the name attribute of the HTML <input> tag) |
| Value | MemoryBlock | A pointer to a memory block containing the value. Must remain valid for the duration of all transfers. |
| Filename | String | The file name to use. |
| ContentType | String | Optional. The Content-Type of the file (e.g. text/html.) |
Returns True if the operation succeeded. Check MultipartForm.LastError for the error number if this method returns False.
Pass a string to set a string element or a folderitem to set a file upload element. You may also pass an instance of EasyHandle to have libcURL raise its DataNeeded event whenever the form element contents are needed, or a pointer to a buffer that contains file data.
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2014-26 Andrew Lambert, offered under the CC BY-SA 3.0 License.