Home Forums .NET libraries Xceed SFTP/FTP for .NET FtpConnection error for server addresses with a specific folder on ftp

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #21162 |

    Hi

    I am using xceed ftp to move files from local machines to ftp locations. There is some issue for moving files when the server address is something like this… “fto.server.net/SomeFolder”… I did check in forums and documentation but could not find any solution.

    Snippet of the code I am using:

    Dim

    connection As FtpConnection
    ‘get the connection to destination ftp loaction
    connection = New FtpConnection(“http://ftp.server.net/SomeFolder“, <some username>, <some password>)
    ‘connection.TestConnection()

    Dim
    ftpfolder As New FtpFolder(connection) ”’ error occurs here

    Dim source As New DiskFile(“D:\file_name.txt”)

    ‘ Get the file and move it to a ftpfolder(UNCUpload)
    source.MoveTo(ftpfolder, True)

    connection.CloseConnections()

    The application breaks at the new FtpFolder object creation line with the following error:
     An error occurred while getting the starting folder.

    Can’t we give ftp location along with a specific folder to move/copy fiiles in it?
    Please if anybody can throw a light on this. Quick fix needs to be done for this.

    Thanks in advance
    SK

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by S (had 2128 views)

    User (Old forums)
    Member
    Post count: 23064

    The way to do this is to create the FtpConnection with the host name only (e.g. http://ftp.server.net), then create an FtpFolder using the connection (e.g. new FtpFolder( ftpConnection, “SomeFolder” );

     

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by André (had 2704 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.