Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-25-2014, 01:16 PM
secureus secureus is offline
Registered User
 
Join Date: Sep 2014
Posts: 14
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
Reply With Quote
  #2  
Old 09-25-2014, 01:29 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
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
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
Reply

Tags
sfxcl , vb script

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 11:54 AM.