Is there any command line tool or executable available for FTP/ SFTP

0

Hi,

Our requirement is to Upload/ Download files using command line tool in SQL queries/ job. Does ComponentPro have any command line tool or application which can be invoked via SQL ?

Thanks,

Ankur Mehta

edited 12/2/2017 10:26:43 PM
asked 5/24/2016 5:45:52 AM
add a comment

1 Answers

0

Yes, you can use it in SQL Server. The following steps show you how to do so:

To have our components listed in the VS References dialog, copy Ultimate assemblies into C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\. Add Ultimate assemblies into Global Assembly Cache (GAC) or copy the assemblies to C:\Program Files\Microsoft SQL Server\90\DTS\Binn. To use the component in SSIS Script Task, add reference to the needed components in the Project Explorer window. Then you can use the following code to connect to your server:

$client = New-Object ComponentPro.Net.Sftp $client.Connect("myserver") $client.Authenticate("user", "pass") $client.DownloadFile("/test.dat", "c:\temp\test.dat") $client.UploadFile("c:\temp\test.dat", "/test2.dat") $client.DeleteFile("/test2.dat") $client.Disconnect() $client.Dispose()
 
answered 11/16/2017 12:41:37 AM
add a comment

Your Answer

Not the answer you're looking for? Browse other questions tagged ftp sftp or ask your own question.