Not really sure since I have not uploaded anything to FTP with vb.net, but could you just not use:
Dim file() As Byte = System.IO.File.ReadAllBytes("c:\mybackups.zip")
Dim file2() As Byte = System.IO.File.ReadAllBytes("c:\mybackups2.zip")
Dim file3() As Byte = System.IO.File.ReadAllBytes("c:\mybackups3.zip")
Dim strz As System.IO.Stream = request.GetRequestStream()
strz.Write(file, 0, file.Length)
strz.Write(file2, 0, file.Length)
strz.Write(file3, 0, file.Length)
Do let me know if that works.:)
codeorder
Posting Virtuoso
1,913 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
Managed to find something simpler using My.Computer.Network.UploadFile .
Dim myFTPaddress As String = "ftp://codeorder.net/"
Dim myFTPuserName As String = "your username here"
Dim myFTPuserPassword As String = "your login password here"
Dim myFiles() As String = {"C:\test1.png", "C:\test2.png", "C:\test3.png"} '// files for testing.
Dim sTemp As String = Nothing '// used to extract only FileName with Extenstion.
For Each mySelectedFile As String In myFiles '// loop thru your files.
sTemp = IO.Path.GetFileName(mySelectedFile) '// get only the file name with extension from Full Path.
'// upload File to website.
My.Computer.Network.UploadFile(mySelectedFile, myFTPaddress & sTemp, myFTPuserName, myFTPuserPassword)
Next
MsgBox("File(s) Upload Successful.", MsgBoxStyle.Information)
codeorder
Posting Virtuoso
1,913 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384