I am working on VS 2012 - .Net Framework 4.0, Vb.Net
I am getting ByteArray as Input paramter from a Front End Application, I want to create the file in the Linux server using sftp connection.
Below is my existing function which writes the file (.csv) in the Linux Server which is working with ftp connection.
Whether SecureFX Client Pack or Sfxcl.exe has some methods to implement WriteFileBytes ? I am comfortable with Vb Script or .Net or batch file or any format of code which can write the ByteArray.
Code:
Public Function UploadFileFromStream(ByVal data As Byte(), ByVal fileName As String) As Boolean
Try
' Assume FTP authentication is success
MyClass.Method = System.Net.WebRequestMethods.Ftp.UploadFile
' This function writes ByteArray variable to file
Using request As System.IO.Stream = MyClass.GetRequestStream()
request.Write(data, 0, data.Length)
request.Close()
End Using
Catch ex As Exception
End Try
Return True
End Function