MultiPartFormEncoding (HttpRequest property): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
mNo edit summary |
||
(13 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{Template: | {{Template:HttpRequest:MultiPartFormEncoding subtitle}} | ||
The <var>MultiPartFormEncoding</var> property sets and returns a <var>[[Boolean_enumeration|Boolean enumeration]]</var> (<var>True</var> or <var>False</var>) that indicates whether Multipart Form encoding support is on or off. If on (<var>True</var>), an <var>HttpRequest</var> object can send file data to a web site from either a <var>Longstring</var> or a <var>Stringlist</var>. | |||
The Post of file data using this encoding support emulates an HTML form that uses <code>enctype="multipart/form-data"</code> and a <code>type="file"</code> input field. | |||
==Syntax== | ==Syntax== | ||
{{Template: | {{Template:HttpRequest:MultiPartFormEncoding syntax}} | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>% | <tr><th>%currentBoolean</th> | ||
<td>The value (< | <td>The value (<var>True</var> or <var>False</var>) of <var class="term">httpRequest</var>'s <var>MultiPartFormEncoding</var> property.</td></tr> | ||
</td></tr> | <tr><th>httpRequest</th> | ||
<tr><th> | <td>A previously defined and instantiated <var>HttpRequest</var> object.</td></tr> | ||
<td>A previously defined and instantiated | <tr><th>newBoolean</th> | ||
</td></tr> | <td>The <var>Boolean</var> enumeration value (<var>True</var> or <var>False</var>) to assign to <var class="term">httpRequest</var>'s <var>MultiPartFormEncoding</var> property.</td></tr> | ||
<tr><th> | </table> | ||
<td>The Boolean enumeration value (< | |||
</td></tr></table> | |||
==Usage notes== | ==Usage notes== | ||
Line 31: | Line 21: | ||
<ol> | <ol> | ||
<li>Set <var>MultiPartFormEncoding</var> to <code>True</code>. | <li>Set <var>MultiPartFormEncoding</var> to <code>True</code>. | ||
<li>Add form data to the HTTP request with the <var>[[AddField ( | <li>Add form data to the HTTP request with the <var>[[AddField (HttpRequest subroutine)|AddField]]</var> method. | ||
method. | <li>Use the <var>[[Post (HttpRequest function)|Post]]</var> function to send the request. | ||
<li>Use the <var>[[Post ( | |||
to send the request. | |||
</ol> | </ol> | ||
<li>MultiPartFormEncoding must be set to | <li>MultiPartFormEncoding must be set to <var>True</var> '''before''' any <var>AddField</var> statements are issued, or the request is cancelled. | ||
<var>True</var> '''before''' any <var>AddField</var> statements are issued, | <li>For an example of code that uses the <var>MultiPartFormEncoding</var> property, see <var>[[AddField (HttpRequest subroutine)#Example|this]]</var> <var>AddField</var> example. | ||
or the request is cancelled. | |||
<li>For an example of code that uses the <var>MultiPartFormEncoding</var> | |||
property, see <var>[[AddField ( | |||
</ul> | </ul> | ||
==See also== | ==See also== | ||
{{Template: | <ul><li>For more general information and background about using Enumerations, see [[Enumerations|"Enumerations"]]. | ||
</ul> | |||
{{Template:HttpRequest:MultiPartFormEncoding footer}} |
Latest revision as of 20:20, 21 June 2011
Use Stringlists for data transfer? (HttpRequest class)
The MultiPartFormEncoding property sets and returns a Boolean enumeration (True or False) that indicates whether Multipart Form encoding support is on or off. If on (True), an HttpRequest object can send file data to a web site from either a Longstring or a Stringlist.
The Post of file data using this encoding support emulates an HTML form that uses enctype="multipart/form-data"
and a type="file"
input field.
Syntax
%currentBoolean = httpRequest:MultiPartFormEncoding httpRequest:MultiPartFormEncoding = newBoolean
Syntax terms
%currentBoolean | The value (True or False) of httpRequest's MultiPartFormEncoding property. |
---|---|
httpRequest | A previously defined and instantiated HttpRequest object. |
newBoolean | The Boolean enumeration value (True or False) to assign to httpRequest's MultiPartFormEncoding property. |
Usage notes
- To enable file-based form uploads:
- MultiPartFormEncoding must be set to True before any AddField statements are issued, or the request is cancelled.
- For an example of code that uses the MultiPartFormEncoding property, see this AddField example.
See also
- For more general information and background about using Enumerations, see "Enumerations".