Secure FTP
hi everybody ,Can anybody tell me about Secure FTP and how the code for uploading and downloading of files can be write using Visual C# actually i have created code for Standad FTP(normal FTP), but when I am using it for secure FTP then the compiler is giving an Exception: "Unable to create Remote Server"very confuse about what to do....??even very small help would be very very appreciablethanx .... Nics
April 9th, 2008 3:33pm
SSIS doesn't support SFTP as of now. Prefer some other third party components from nsoftware, Xceed FTP, CozyRoc.
Free Windows Admin Tool Kit Click here and download it now
April 9th, 2008 3:57pm
thax dear, for aour valuable suggetion
April 9th, 2008 7:58pm
Sounds good. Please close the thread by mark it as answered.
Free Windows Admin Tool Kit Click here and download it now
April 9th, 2008 8:35pm
What I have done is use a Script Task to open an external SFTP process (like scp.exe) with parameters, and handle the standard and error output to control the outcome. There are a few SFTP components available for free out there (like OpenSSH's library).
Something like:
Code Snippet
' Create process
Dim proc As New System.Diagnostics.Process()
proc.StartInfo.FileName = Dts.Variables("User::scp_path").Value.ToString()
proc.StartInfo.UseShellExecute = False
proc.StartInfo.CreateNoWindow = True
proc.StartInfo.RedirectStandardError = True
proc.StartInfo.RedirectStandardInput = True
proc.StartInfo.RedirectStandardOutput = True
proc.EnableRaisingEvents = True
Dim err As String
Dim out As String
' Enter download command which passes login info
proc.StartInfo.Arguments = Dts.Variables("User::Src_User").Value.ToString()
proc.StartInfo.Arguments = proc.StartInfo.Arguments & "@" & Dts.Variables("User::Src_Server").Value.ToString()
proc.StartInfo.Arguments = proc.StartInfo.Arguments & ":" & Dts.Variables("User::Src_File_Name").Value.ToString()
proc.StartInfo.Arguments = proc.StartInfo.Arguments & " " & Dts.Variables("User::Target_File_Path").Value.ToString()
' Start process
proc.Start()
proc.WaitForExit()
' Set StandardInput autoflush
proc.StandardInput.AutoFlush = True
' Get error output
err = proc.StandardError.ReadToEnd()
out = proc.StandardOutput.ReadToEnd()
.....
It has worked well.
April 9th, 2008 10:46pm
Hi Ted,
Could you please give me complete code what u have written for getting SFTP done.
Then what are the values you have given for the user deifned variables you have defined above.
Please can you get this to me ASAP.
Thanks in advance
Free Windows Admin Tool Kit Click here and download it now
May 13th, 2008 8:43am
Hi,
for SFTP what we did on SSIS was to use an external EXE form Vandike:
http://www.van***.com/
We executed the SFTP download adding the params to perform the download (there was a config as well for user and password) and then retrieve the result of the execution (the EXE returns a given value, success or failure).
I think this software is not quite expensive and you can even download a trial to check if fits your needs.
Good luck
Braulio
May 13th, 2008 11:32am
I am running Putty.exe for connecting to SFTP. I am able to connect it, But a need to login each time in to it(for server). I want ot autologin into it. Is this possible? If yes how?
Free Windows Admin Tool Kit Click here and download it now
July 1st, 2008 4:32pm
Seeing that many people are trying to use WinSCP to implement SSIS SFTP transfer task, I have prepared a guide to SFTP Task for SSIS .
April 2nd, 2009 10:42am
Have you tried these SFTP libs?
Free Windows Admin Tool Kit Click here and download it now
July 7th, 2010 1:23am
Which kind of Secure FTP do you want to use? There are at least two completely different protocols which are called "Secure FTP":
FTP/SSL = plain, old FTP run over TLS/SSL encrypted channel. Sometimes called FTPS
SFTP = SSH File Transfer Protocol. Completely different beast.
For details see http://www.rebex.net/kb/secure-ftp.aspx
FTP/SSL is implemented in Rebex FTP/SSL component and SFTP in
Rebex SFTP component . Following blogpost shows
how to use those SFTP and FTP libraries in SSIS package via the script taks .
October 12th, 2010 10:46pm
See the following code demonstrating uploading and download files using
Ultimate FTP component :
Uploading files
// Create a new instance.
Ftp client = new
Ftp();
// Connect to the FTP server.
client.Connect(
"localhost" );
// Authenticate.
client.Authenticate(
"test" ,
"test" );
// ...
// Upload all files and subdirectories from local folder 'c:\temp' to the remote dir '/temp'
client.UploadFiles(
"c:\\temp" ,
"/temp" );
// Upload all directories, subdirectories, and files that match the specified search pattern from local folder 'c:\myfolder2' to remote folder '/myfolder2'.
client.UploadFiles(
"c:\\myfolder2" ,
"/myfolder2" ,
"*.cs" );
// or you can simply put wildcard masks in the source path, our component will automatically parse it.
// upload all *.css files from local folder 'c:\myfolder2' to remote folder '/myfolder2'.
client.UploadFiles(
"c:\\myfolder2\\*.css" ,
"/myfolder2" );
// Upload *.cs and *.vb files from local folder 'c:\myfolder2' to remote folder '/myfolder2'.
client.UploadFiles(
"c:\\myfolder2\\*.cs;*.vb" ,
"/myfolder2" );
// ...
// Disconnect.
client.Disconnect();
Downloading files
// Create a new instance.
Ftp client = new
Ftp();
// Connect to the FTP server.
client.Connect(
"localhost" );
// Authenticate.
client.Authenticate(
"test" ,
"test" );
// ...
// Get all directories, subdirectories, and files from remote folder '/myfolder' to 'c:\myfolder'.
client.DownloadFiles(
"/myfolder" ,
"c:\\myfolder" );
// Get all directories, subdirectories, and files that match the specified search pattern from remote folder '/myfolder2' to 'c:\myfolder2'.
client.DownloadFiles(
"/myfolder2" ,
"c:\\myfolder2" ,
"*.cs" );
// or you can simply put wildcard masks in the source path, our component will automatically parse it.
// download all *.css files from remote folder '/myfolder2' to local folder 'c:\myfolder2'.
client.DownloadFiles(
"/myfolder2/*.css" ,
"c:\\myfolder2" );
// Download *.cs and *.vb files from remote folder '/myfolder2' to local folder 'c:\myfolder2'.
client.DownloadFiles(
"/myfolder2/*.cs;*.vb" ,
"c:\\myfolder2" );
// Get files in the folder '/myfolder2' only.
TransferOptions opt =
new TransferOptions(true, false, false, (SearchCondition)
null , FileExistsResolveAction.OverwriteAll, SymlinksResolveAction.Skip, false);
client.DownloadFiles( "/myfolder2"
, "c:\\myfolder2"
, opt);
// ...
// Disconnect.
client.Disconnect();
If you need SFTP functionality, check out the
Ultimate SFTP library .
Free Windows Admin Tool Kit Click here and download it now
October 21st, 2010 7:50pm