VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   Whether Vralib.dll or sfxcl.exe have a method as WriteFileBytes ? (https://forums.vandyke.com/showthread.php?t=11712)

secureus 09-25-2014 02:16 PM

Whether Vralib.dll or sfxcl.exe have a method as WriteFileBytes ?
 
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


rtb 09-25-2014 02:29 PM

Hi secureus,

A file must exist locally if you want to use SFXCL to transfer a file.

Please see the following post for direction about your ByteArray question:
https://forums.vandyke.com/showthread.php?t=11701


All times are GMT -6. The time now is 11:13 PM.