[ Fantom. @ 18.06.2013. 20:18 ] @
Radi se o Visual Basicu 2008 kako mogu da izvrsim upload celog foldera
Evo mog koda sa kojim mogu samo ZIP.RAR.JPG itd dakle odredjene Extenzije
Ako neko moze da mi pomogne.
Da me uputi :)

Dim myFTPaddress As String = "ftp://adresa.net/"
Dim myFTPuserName As String = "usr"
Dim myFTPuserPassword As String = "sifra"
Dim myFiles() As String = {"C:\test1.zip", "}
Dim sTemp As String = Nothing
For Each mySelectedFile As String In myFiles
sTemp = IO.Path.GetFileName(mySelectedFile)

My.Computer.Network.UploadFile(mySelectedFile, myFTPaddress & sTemp, myFTPuserName, myFTPuserPassword)
Next
MsgBox("File(s) fajl je poslat.", MsgBoxStyle.Information)
[ petarminic @ 23.07.2013. 14:44 ] @
Ovo je deo mog koda preko koga Å¡aljem fijlove.


Imports System.Net
------------------------------------------
Dim localFile As String = Application.StartupPath & "\" & NazivFajla & ".csv"
Dim host As String = "ftp://123.123.123.123:21203/" & NazivFajla & ".csv"
Const username As String = "user"
Const password As String = "pass"

Dim credential As New NetworkCredential(username, password)

Dim request As FtpWebRequest = DirectCast(WebRequest.Create(host), FtpWebRequest)
request.Method = WebRequestMethods.Ftp.UploadFile
request.Credentials = credential
request.UseBinary = True
request.KeepAlive = False

Dim reader As New FileStream(localFile, FileMode.Open)
Dim buffer(Convert.ToInt32(reader.Length - 1)) As Byte

reader.Read(buffer, 0, buffer.Length)
reader.Close()
request.ContentLength = buffer.Length

Dim stream As Stream = request.GetRequestStream
stream.Write(buffer, 0, buffer.Length)
stream.Close()

Dim response As FtpWebResponse = DirectCast(request.GetResponse, FtpWebResponse)

response.Close()

request = Nothing