Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.6k views
in .NET FTP by (240 points)
I am trying to use the edtFTPnetFree library to upload files to a EDI server. I am getting the following error:

"The requested name is valid, but no data of the requested type was found."

Here is the code I am using:

        Try
            'connect to ftp server
            Dim ftp As New FTPConnection
            ftp.ServerAddress = ediServer
            ftp.UserName = login
            ftp.Password = password
            ftp.Protocol = FileTransferProtocol.FTP
            ftp.ConnectMode = FTPConnectMode.PASV
            ftp.Connect()
            ftp.TransferType = FTPTransferType.ASCII

            'upload a file
            ftp.UploadFile("D:\MOTION_810_504450_20110810114758.xml", "test.xml")
          
            'close the connection
            ftp.Close()

        Catch ex As Exception
            MessageBox.Show(ex.Message.ToString())
        End Try


Note that I can upload fine using the .Net FtpWebRequest class. Any help would be appreciated. Thanks...

5 Answers

0 votes
by (162k points)
Enabling logging and post the relevant part of the log file. There's details on how to do that in the User Guide.
0 votes
by (240 points)
This is what is in the log file:

DEBUG [FTPConnection] 12 Aug 2011 08:20:18.128 : Set LocalDirectory='D:\VB\Projects\FTP Test\FTP Test\bin\Debug'
DEBUG [FTPClient] 12 Aug 2011 08:20:18.169 : Connecting to ftp://myserver/:21
DEBUG [HostNameResolver] 12 Aug 2011 08:20:18.267 : Resolving ftp://myserver/

Note that I replaced the actual server name with "myserver".
0 votes
by (162k points)
[Try setting the server name to "myserver" instead of using the ftp prefix.
0 votes
by (240 points)
I get the same error message. The log file says the same thing too.
0 votes
by (240 points)
I got it to work. I was specifying the full path in the ServerAddress string. When I changed it to just the root address it worked.

Categories

...