Class: MASPluginMultipartForm

MASPluginMultipartForm

A class to create and set Multipart form details for a POST request.
MASPluginMultipartForm Constructor
var MASMultipartForm = new MASPlugin.MASMultipartForm();

Methods

addFiles(fileName, filePath, fileMimeType, fileFieldName, fileData)

Adds a file object to the multipart form
Parameters:
Name Type Description
fileName string Name of the file to be uploaded
filePath string Local path of the file on the SD/drive on the phone. The path should be accessible by native platform.
fileMimeType string Type of the file ex. "text/plain" or "image/png" etc.
fileFieldName string Field name in the multipart form request
fileData string Base64 Encoded bytes of the file. If not available,make sure that filePath is on a readable path on card.
Deprecated:
  • Yes
Source:

addFiles(fileName, fileMimeType, fileFieldName, fileData)

Adds a file object to the multipart form
Parameters:
Name Type Description
fileName string Name of the file to be uploaded
fileMimeType string Type of the file ex. "text/plain" or "image/png" etc.
fileFieldName string Field name in the multipart form request
fileData string Base64 Encoded bytes of the file. If not available,make sure that filePath is on a readable path on card.
Source:

addFormData(key, value)

Allows to add key value pairs (ASCII) to the form data
Parameters:
Name Type Description
key string The name of the attribute
value string The value of the attribute
Source:

getMultipartForm() → {Object}

Returns the final JavaScript Object representation of MASPluginMultipartForm in JSON format.
Source:
Returns:
The MASPluginMultipartForm object.
Type
Object