MultiPartFormEncoding (HttpRequest property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (match syntax table to syntax template; edits, tags and links)
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>.


This property sets and returns a <var>[[Enumerations#Using Boolean enumerations|Boolean]]</var> enumeration
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.
(<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 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==
==Syntax==
{{Template:HttpRequest:MultiPartFormEncoding syntax}}
{{Template:HttpRequest:MultiPartFormEncoding syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%curr</th>
<tr><th>%currentBoolean</th>
<td>The value (<code>True</code> or <code>False</code>) of ''%httpreq'''s MultiPartFormEncoding property.
<td>The value (<code>True</code> or <code>False</code>) of <var class="term">httpRequest</var>'s MultiPartFormEncoding property.</td></tr>
</td></tr>
<tr><th>%httpRequest</th>
<tr><th>%httpreq</th>
<td>A previously defined and instantiated <var>HttpRequest</var> object.</td></tr>
<td>A previously defined and instantiated <var>HttpRequest</var> object.
<tr><th>newBoolean</th>
</td></tr>
<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>
<tr><th>newvalue</th>
</table>
<td>The Boolean enumeration value (<code>True</code> or <code>False</code>) to assign to ''%httpreq'''s MultiPartFormEncoding property.
 
</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 (HttpRequest subroutine)|AddField]]</var>
<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 (HttpRequest function)|Post]]</var> function
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 (HttpRequest subroutine)#Example|this]]</var> <var>AddField</var> example.
<li>For information about Enumerations, see [[Enumerations|"Enumerations"]].
</ul>
</ul>
==See also==
==See also==
<ul><li>For more general information and background about using Enumerations, see [[Enumerations|"Enumerations"]].
</ul>
{{Template:HttpRequest:MultiPartFormEncoding footer}}
{{Template:HttpRequest:MultiPartFormEncoding footer}}

Revision as of 00:43, 19 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".