mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +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:
|
||||
* 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