-
Upload to an FTP
Gurus
I have the following code
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim FTPrequest As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create("FTPURL"), System.Net.FtpWebRequest)
FTPrequest.Credentials = New System.Net.NetworkCredential("UserName", "Password")
FTPrequest.Method = System.Net.WebRequestMethods.Ftp.UploadFile
Dim file() As Byte = System.IO.File.ReadAllBytes("C:\Filename.zip")
Dim StreamStr As System.IO.Stream = FTPrequest.GetRequestStream()
StreamStr.Write(filename, 0, filename.Length)
streamStr.Dispose()
End Sub
but how do I go and pick the right folder within the FTP site, once I go into the FTP I have to pick IN or OUT and within those Folder to pick the right one to upload the files.
Thanks a bunch for any help I can get
-
Re: Upload to an FTP
ftp://whateveryourftpsite/folder/folder/folder/file
Enjoy (my ftp asks for an account and once u login to that account it automatic gives you the folder that is assigned to the account
-
Re: Upload to an FTP
gurus
I am trying to upload a file into a folder, but I get this error " The remote server returned an error(550) file unavailable"
I have this code where is getting the error from
dim streamstr as system.IO.stream =ftprequest.getrequeststream()
Thanks a bunch gurus