This project is read-only.

sftpClient.UploadFile(fileStream, fileInfo.get_Name(), null); FAILED

Jul 1, 2015 at 5:07 PM
Hi,

I have successfully made the connection to SFTP server using SFtpClient class.

I am trying to upload a file using SFtpClient.upload() using below syntax,
sftpClient.UploadFile(fileStream, fileInfo.get_Name(), null);

Where fileStream is the object of System.IO.FileStream() and fileInfo is the object of System.IO.FileInfo()

but i am getting below error while executing this syntax.

System.Reflection.AmbiguousMatchException: Ambiguous match found.

at System.RuntimeType.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConv, Type[] types, ParameterModifier[] modifiers)

at System.Type.GetMethod(String name)

at Microsoft.Dynamics.AX.ManagedInterop.ClrBridgeImpl.GetMethodInfo(ClrBridgeImpl* , Type pType, Char* pszMethodName, Type[] argumentTypes)

at Microsoft.Dynamics.AX.ManagedInterop.ClrBridgeImpl.InvokeClrInstanceMethod(ClrBridgeImpl* , ObjectWrapper* objectWrapper, Char* pszMethodName, Int32 argsLength, ObjectWrapper** arguments, Boolean* argsAreByRef, Boolean* isException)![Image]

many thanks in advance.

kind regards,