MultiPartFormEncoding (HttpRequest property)

From m204wiki
Revision as of 20:20, 21 June 2011 by JAL2 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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".