mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-22 01:19:36 +08:00
docs(transfer): example added for Transfer plugin (#349)
This commit is contained in:
parent
075842d69d
commit
cb24876f23
@ -127,6 +127,27 @@ export interface FileTransferError {
|
|||||||
*
|
*
|
||||||
* // Abort active transfer:
|
* // Abort active transfer:
|
||||||
* fileTransfer.abort();
|
* fileTransfer.abort();
|
||||||
|
*
|
||||||
|
* E.g
|
||||||
|
*
|
||||||
|
* upload(){
|
||||||
|
* const fileTransfer = new Transfer();
|
||||||
|
* var options: any;
|
||||||
|
*
|
||||||
|
* options = {
|
||||||
|
* fileKey: 'file',
|
||||||
|
* fileName: 'name.jpg',
|
||||||
|
* headers: {}
|
||||||
|
* .....
|
||||||
|
* }
|
||||||
|
* fileTransfer.upload("<file path>", "<api endpoint>", options)
|
||||||
|
* .then((data) => {
|
||||||
|
* // success
|
||||||
|
* }, (err) => {
|
||||||
|
* // error
|
||||||
|
* })
|
||||||
|
* }
|
||||||
|
*
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user