Results 1 to 3 of 3

Thread: Upload to an FTP

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Posts
    138

    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

  2. #2
    Lively Member
    Join Date
    Jul 2011
    Posts
    70

    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

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Posts
    138

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width