The goog.gears.MultipartFormData Class

goog.gears.MultipartFormData()

Creates a new multipart form data builder.

.addBlob(name, fileName, blob)

Adds a Gears blob as a file to the multipart.

name {string}
The name of the value.
fileName {string}
The name of the file.
blob {GearsBlob}
The blob to add.
returns {goog.gears.MultipartFormData}
The form builder itself.

.addFile(name, gearsFile)

Adds a Gears file to the multipart.

name {string}
The name of the value.
gearsFile {GearsFile}
The Gears file as returned from openFiles etc.
returns {goog.gears.MultipartFormData}
The form builder itself.

.addText(name, value)

Adds some text to the multipart.

name {string}
The name of the value.
value {*}
The value. This will use toString on the value.
returns {goog.gears.MultipartFormData}
The form builder itself.

.getAsBlob()

returns {GearsBlob}
The blob to use in the send method of the GearsHttpRequest.

.getContentType()

The content type to set on the GearsHttpRequest. var builder = new MultipartFormData; ... ghr.setRequestHeader('Content-Type', builder.getContentType()); ghr.send(builder.getAsBlob());

returns {string}
The content type string to be used when posting this with a GearsHttpRequest.