MultiPartFormEncoding (HttpRequest property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (match syntax table to syntax template; edits, tags and links)
mNo edit summary
 
Line 1: Line 1:
{{Template:HttpRequest:MultiPartFormEncoding subtitle}}
{{Template:HttpRequest:MultiPartFormEncoding subtitle}}
The <var>MultiPartFormEncoding</var> property sets and returns a <var>[[Boolean_enumeration|Boolean enumeration]]</var> (<code>True</code> or <code>False</code>) that indicates whether Multipart Form encoding support is on or off.  If on (<code>True</code>), 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 <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 enctype="multipart/form-data" and a type="file" input field.
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==
Line 9: Line 9:
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%currentBoolean</th>
<tr><th>%currentBoolean</th>
<td>The value (<code>True</code> or <code>False</code>) of <var class="term">httpRequest</var>'s MultiPartFormEncoding property.</td></tr>
<td>The value (<var>True</var> or <var>False</var>) of <var class="term">httpRequest</var>'s <var>MultiPartFormEncoding</var> property.</td></tr>
<tr><th>%httpRequest</th>
<tr><th>httpRequest</th>
<td>A previously defined and instantiated <var>HttpRequest</var> object.</td></tr>
<td>A previously defined and instantiated <var>HttpRequest</var> object.</td></tr>
<tr><th>newBoolean</th>
<tr><th>newBoolean</th>
<td>The Boolean enumeration value (<code>True</code> or <code>False</code>) to assign to <var class="term">httpRequest</var>'s MultiPartFormEncoding property.</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>
</table>
</table>



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:
    1. Set MultiPartFormEncoding to True.
    2. Add form data to the HTTP request with the AddField method.
    3. Use the Post function to send the request.
  • 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".