cordova-plugin-mas-core
Version:
Cordova MAS Foundation Plugin
871 lines (211 loc) • 11.1 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: MASPluginMultipartForm</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: MASPluginMultipartForm</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>MASPluginMultipartForm</h2>
<div class="class-description">A class to create and set Multipart form details for a POST request.
<table>
<tr bgcolor="#D3D3D3"><th>MASPluginMultipartForm Constructor</th></tr>
<tr><td><i>var MASMultipartForm = new MASPlugin.MASMultipartForm();</td></tr>
</table></div>
</header>
<article>
<div class="container-overview">
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMultipartForm.js.html">MASPluginMultipartForm.js</a>, <a href="MASPluginMultipartForm.js.html#line8">line 8</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="addFiles"><span class="type-signature"></span>addFiles<span class="signature">(fileName, filePath, fileMimeType, fileFieldName, fileData)</span><span class="type-signature"></span></h4>
<div class="description">
Adds a file object to the multipart form
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>fileName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Name of the file to be uploaded</td>
</tr>
<tr>
<td class="name"><code>filePath</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Local path of the file on the SD/drive on the phone. The path should be accessible by native platform.</td>
</tr>
<tr>
<td class="name"><code>fileMimeType</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Type of the file ex. "text/plain" or "image/png" etc.</td>
</tr>
<tr>
<td class="name"><code>fileFieldName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Field name in the multipart form request</td>
</tr>
<tr>
<td class="name"><code>fileData</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Base64 Encoded bytes of the file. If not available,make sure that filePath is on a readable path on card.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMultipartForm.js.html">MASPluginMultipartForm.js</a>, <a href="MASPluginMultipartForm.js.html#line34">line 34</a>
</li></ul></dd>
</dl>
<h4 class="name" id="addFiles"><span class="type-signature"></span>addFiles<span class="signature">(fileName, fileMimeType, fileFieldName, fileData)</span><span class="type-signature"></span></h4>
<div class="description">
Adds a file object to the multipart form
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>fileName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Name of the file to be uploaded</td>
</tr>
<tr>
<td class="name"><code>fileMimeType</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Type of the file ex. "text/plain" or "image/png" etc.</td>
</tr>
<tr>
<td class="name"><code>fileFieldName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Field name in the multipart form request</td>
</tr>
<tr>
<td class="name"><code>fileData</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Base64 Encoded bytes of the file. If not available,make sure that filePath is on a readable path on card.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMultipartForm.js.html">MASPluginMultipartForm.js</a>, <a href="MASPluginMultipartForm.js.html#line58">line 58</a>
</li></ul></dd>
</dl>
<h4 class="name" id="addFormData"><span class="type-signature"></span>addFormData<span class="signature">(key, value)</span><span class="type-signature"></span></h4>
<div class="description">
Allows to add key value pairs (ASCII) to the form data
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The name of the attribute</td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The value of the attribute</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMultipartForm.js.html">MASPluginMultipartForm.js</a>, <a href="MASPluginMultipartForm.js.html#line21">line 21</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getMultipartForm"><span class="type-signature"></span>getMultipartForm<span class="signature">()</span><span class="type-signature"> → {Object}</span></h4>
<div class="description">
Returns the final JavaScript Object representation of MASPluginMultipartForm in JSON format.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginMultipartForm.js.html">MASPluginMultipartForm.js</a>, <a href="MASPluginMultipartForm.js.html#line79">line 79</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The MASPluginMultipartForm object.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="MASPlugin.html">MASPlugin</a></li><li><a href="MASPluginApplication.html">MASPluginApplication</a></li><li><a href="MASPluginAuthProviders.html">MASPluginAuthProviders</a></li><li><a href="MASPluginConstants.html">MASPluginConstants</a></li><li><a href="MASPluginDevice.html">MASPluginDevice</a></li><li><a href="MASPluginMAS.html">MASPluginMAS</a></li><li><a href="MASPluginMultipartForm.html">MASPluginMultipartForm</a></li><li><a href="MASPluginSecurityConfiguration.html">MASPluginSecurityConfiguration</a></li><li><a href="MASPluginUser.html">MASPluginUser</a></li><li><a href="MASPluginUtils.html">MASPluginUtils</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Tue Feb 18 2020 21:13:36 GMT+0530 (India Standard Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>