Hi
I'm trying to find out how to tranfer a file to a ftp-cataloug located in an
UNIX server.
My app is a Win service (without UI).
My user as I logging to the UNIX-server with is pointing to at catalouge like:
'/dfs/shared/sdi/home' and my actual target is like
'/dfs/shared/sdi/dev/job'.
My code looks like:
Dim FTPtarget As String = "nserver/dfs/shared/sdi/dev/job"
Dim FileI As New FileInfo(filename)
Dim UriString As String = "ftp://" + FTPtarget + "/" + FileI.Name
Dim reqFtp As FtpWebRequest
Try
' Creates the FtpWebRequest object
reqFtp = CType(WebRequest.CreateDefault(New Uri(UriString)),
FtpWebRequest)
' Sets the required properties
reqFtp.Credentials = New NetworkCredential(ftpUserId,
ftpPassword)
reqFtp.KeepAlive = False
reqFtp.Method = WebRequestMethods.Ftp.UploadFile
reqFtp.UseBinary = True
reqFtp.ContentLength = FileI.Length
' The buffer size is set to 2kb and defines the streaming
objects
Dim buffLength As Integer = 2048
Dim buff(2048) As Byte
Dim contentLen As Integer
Dim fs As FileStream = FileI.OpenRead()
Dim strm As Stream = reqFtp.GetRequestStream()
I need to move in the Unix directory like this (in cmd window):
cd ..
cd dev
cd job
to pointing to right target catalouge.
But how can I manage this in my one shoot (file transfer) code?
Hopefull for an answer
And thankfull for all help
\Peter
Archived from group: microsoft>public>vb>enterprise