
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
com.pdl.cordova.plugin.sftp
Advanced tools
Cordova plugin to Download and Upload files from a SFTP server.
This plugin is build on top of:
Contributors are welcome.
Platforms supported
cordova plugin add cordova-sftp-plugin
There is a base Object JJsftp
expose in window
that should be initialized with the host
, user
and password
for the server
var mySftp = new JJsftp("host", "user", "password");
download(serverPath, localPath [, createIfNotExists, successCallback, errorCallback])
Allow to download a single file.
serverPath
- Path/To/File/In/ServerlocalPath
- Path/To/File/In/DevicecreateIfNotExists
- Create the folder path if not existsuccessCallback
- Function to call in plugin successerrorCallback
- Function to call in plugin errordownloadList(list [, successCallback, errorCallback])
Allow to download a list of files
list
- Object array of files, has the follow attributes:
remote
- Path/To/File/In/Serverlocal
- Local/Path/To/Filecreate
] - default to: false
- Create the folder path if not existsuccessCallback
- Function to call in plugin successerrorCallback
- Function to call in plugin errorupload(serverPath, localPath [, successCallback, errorCallback])
Allow to download a single file.
serverPath
- Path/To/File/In/ServerlocalPath
- Path/To/File/In/DevicesuccessCallback
- Function to call in plugin successerrorCallback
- Function to call in plugin erroruploadList(list [, successCallback, errorCallback])
Allow to download a list of files
list
- Object array of files, has the follow attributes
remote
- Path/To/File/In/Serverlocal
- Local/Path/To/FilsuccessCallback
- Function to call in plugin successerrorCallback
- Function to call in plugin errorcancel([successCallback, errorCallback])
Allow to cancel the asyn process that make the connection
successCallback
- Function to call in plugin successerrorCallback
- Function to call in plugin errorEvery callback (success or error) will response for the action of add the elements downloads/upload list, if you wanna know when a file or all the files are donwloaded, you should listen to the events fires over document.
There are several events that fire during the process, all of it give one arg, the cordova event with few extra attributes
SFTPActionConnected
SFTPActionStart
from
- string : Path of the sourceto
- string : Path of the targetsize
- long : Size of the elementSFTPActionProgress
percent
- int : % of actual file progressSFTPActionEnd
SFTPActionListProgress
progress
- int : Actual element index in listtotal
- int : Total count of elements in listSFTPActionListEnd
all
- boolean : true if all action were made itSFTPActionDisconnected
SFTPActionCancell
To Download
var sftp = new JJsftp("host", "user", "password"),
localPath = "String/Path/To/Place/The/Download"
filelist = [{
remote : "/Path/To/Remote/File.*"
, local : localPath+"file.*"
},{
remote : "/Path/To/Another/Remote/File.*"
, local : localPath+"anotherFile.*"
}];
sftp.downloadList(filelist, function(data){
/* Wow everything goes good, but just in case verify data.success */
}, function(error){
/* Wow something goes wrong, check the error.message */
});
To Upload is the same but calling upload
or uploadList
and by default will override a file if exists in server
Of course if you want, you could add any of the JJsftp events to document and listen the progress of the download by example
#### Know Issues
upload
does not work on iOS (Yet)cancel
does not work on iOS (Yet), therefore SFTPActionCancell
is never trigger.There is a big TODO list, but in resume
download
now available)FAQs
Cordova SFTP Upload And Download
The npm package com.pdl.cordova.plugin.sftp receives a total of 3 weekly downloads. As such, com.pdl.cordova.plugin.sftp popularity was classified as not popular.
We found that com.pdl.cordova.plugin.sftp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.