MultiPartFormEncoding (HttpRequest property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
 
(8 intermediate revisions by 4 users not shown)
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> (<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>.


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 <code>enctype="multipart/form-data"</code> and a <code>type="file"</code> 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 Longstring 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 (<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>%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 <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>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==
{{Template:HTTPRequest:MultiPartFormEncoding footer}}
<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:
    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".