Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


MultipartFormFileSection

A helper object for adding file uploads to multipart forms via the [IMultipartFormSection] API.
Read time 1 minuteLast updated 6 days ago

Definition

public class MultipartFormFileSection : IMultipartFormSection

Remarks

This object is similar to the MultipartFormDataSection object, but all constructors additionally accept (and require) a
fileName
parameter. If you omit the
fileName
parameter, this object provides a default filename.

Constructors

Constructor

Description

MultipartFormFileSection(System.Byte[])Contains an anonymous file section based on the raw bytes from
data
, assigns a default
Content-Type
and file name.
MultipartFormFileSection(System.String,System.Byte[])Contains an anonymous file section based on the raw bytes from
data
with a specific file name. Assigns a default
Content-Type
.
MultipartFormFileSection(System.String,System.Byte[],System.String,System.String)Contains a named file section based on the raw bytes from
data
, with a custom
Content-Type
and file name.
MultipartFormFileSection(System.String,System.String)An anonymous file section with data drawn from the UTF8 string
data
. Assigns a specific file name from
fileName
and a default
Content-Type
.
MultipartFormFileSection(System.String,System.String,System.Text.Encoding,System.String)Contains a named file section with data drawn from
data
, as marshaled by
dataEncoding
. Assigns a specific file name from
fileName
and a default
Content-Type
.
MultipartFormFileSection(System.String,System.Text.Encoding,System.String)An anonymous file section with data drawn from
data
, as marshaled by
dataEncoding
. Assigns a specific file name from
fileName
and a default
Content-Type
.

Properties

Property

Description

contentTypeReturns the value of the section's
Content-Type
header.
fileNameReturns a string denoting the desired filename of this section on the destination server.
sectionDataReturns the raw binary data contained in this section. Will not return null or a zero-length array.
sectionNameReturns the name of this section, if any.