Troubleshooting File Uploads and SFTP Information
Common issues for SFTP can be solved by disabling the "Enable transfer resume/transfer to temporary filename" setting.
Some basic information about SFTP's
For SFTP, successful uploads are processed as soon as they complete, and won't show in the directly listing—effectively the integration is "write-only". This is also meant to avoid any accidental exposure of sensitive data if the SFTP credentials were ever compromised. So as long as there isn't an error uploading, everything is working as intended.
Error Checking
Certain SFTP clients attempt to either check the size of the file or update its permissions or modify its last updated time to the source file's after the upload. Others like WinSCP will upload files with a temporary extension (like .filepart
)by default, then rename after the upload. In these cases an error may be thrown since the file processes nearly instantly and it is possible to get an error when the upload finishes. This renaming can usually be changed in your SFTP client's connection settings. In WinSCP you can disable the "Enable transfer resume/transfer to temporary filename" setting. Others will have a "Preserve file modification dates" option that can be disabled.
transferOptions.ResumeSupport.State = TransferResumeSupportState.Off;
transferOptions.FilePermissions = null;
transferOptions.PreserveTimestamp = false;
transferOptions.TransferMode = TransferMode.Binary;
-resumesupport=off
when passing parameters to the put
command. Other implementations such as third-party SSIS tasks that use WinSCP under the hood usually include UI options for these settings.