Delete file after download

May 7, 2013 at 7:18 PM
Edited May 7, 2013 at 7:19 PM
Hi,
Is there a way to delete the file after I download with this SFTP component?
May 13, 2013 at 5:23 PM
Hi,
Try using the 'Remove Remote' property.
Daniel
Jul 30, 2014 at 1:56 PM
danielforrester wrote:
Hi,
Try using the 'Remove Remote' property.
Daniel
The Remove Remote property is not available in the UI.
Nov 3, 2014 at 10:22 PM
Edited Nov 3, 2014 at 10:32 PM
The 'Remove Remote' property in the UI maps to the removeSource property on the task. Currently though, it is ignored when downloading files. Looking at the source confirms this, and it looks this can be addressed by adding code to delete the file when the property is true via the DownloadFiles method on SFTPConnection.cs after the part where the file is downloaded:
using (FileStream fileStream = File.OpenWrite(filePath.LocalPath))
{
    sftp.DownloadFile(filePath.RemotePath, fileStream);
}
if (filePath.RemoveSource)
{
    sftp.DeleteFile(filePath.RemotePath);
}
Can someone make this change or add me as a contributor? I would like to update the SQL Server 2008R2 version in particular.
Nov 26, 2014 at 8:16 PM
I need this modification too. Can somebody please do something about this? jkobyec, do you have the solution yet?
Coordinator
Dec 30, 2014 at 1:50 PM
This is fixed as of March 2014, please uninstall and re-install the latest version from downloads (published on April 1).

Thanx.