Login  
Search All Forums
Dart Home | PowerTCP FTP for .NET | Custom Development Reply | PowerTCP FTP for .NET Topics | Forums   
AuthorForum: PowerTCP FTP for .NET
Topic: strange paths returned from ListEntry.FullName
GinaM

From: Madison, WI USA
Posts: 4
Member Since: 02/24/12
posted February 24, 2012 5:43 PM

We're creating a function to download all the files from a given directory path - want to be able log which files fail and which succeed granularly rather than pass in list of files to get. We are looping through the results from ListDirectoryTree, but are getting strange paths back for the files from the FullName property. The path passed back is duplicated with switched paths. See the code and example path info below:

objFileList = m_objFTP.ListDirectoryTree(strRemoteDir, "", False)
i = 0
For Each objEntry In objFileList
 If objFileList.Item(i).Type = EntryType.Directory Then
  'process directory
  strLocalDirPath = strLocalDir & Replace(objFileList.Item(i).FullName.ToString, "/", "\")
  System.IO.Directory.CreateDirectory(strLocalDirPath)
 Else
  'process file
  strLocalFile = strLocalDir & Replace(objFileList.Item(i).FullName.ToString, "/", "\")
  m_objFTP.Get(objFileList.Item(i).FullName.ToString, strLocalFile, enumSyncSetting)
 End If
 i += 1
Next

Directory Name passed in: /Home/SA-FTP-M/
Full Name Path passed back from ListEntry.FullName: /Home/SA-FTP-M/\Home\SA-FTP-M/MyFile.doc

What would be causing paths that look like this? Is it a setting on our FTP server or is it something to do w/the component?
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted February 27, 2012 9:36 AM

Hello,

This should be the path sent by your server. If you try to Get that file, does it succeed? Since there is a "/" before the file's name, you may have a folder named "\Home\SA-FTP-M" inside /Home/SA-FTP-M/.
GinaM

From: Madison, WI USA
Posts: 4
Member Since: 02/24/12
posted February 27, 2012 9:56 AM

Thanks for the reply. No, unfortunately the get fails with "550 RETR failed: File could not be found" when we use the path returned by the server. Is there any configuration that might need to be made for that account's home directory?
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted February 27, 2012 10:16 AM

Hello,

We don't know any details about your server, and we're unable to provide assistance for third-party applications. It probably wouldn't be a standard configuration option.

Are you able to check if that folder actually does exist in your server's file system? It's possible that it's only unable to return the file, but it does exist.
GinaM

From: Madison, WI USA
Posts: 4
Member Since: 02/24/12
posted February 27, 2012 10:42 AM

The path /Home/SA-FTP-M/ does exist, but there isn't another set of subfolders under it (that I can see). I'll confirm w/the FTP server administrators to see if they're seeing something different. If you specify a file like /Home/SA-FTP-M/test.doc in code to download an individual file, it works fine. The problem we're having is when we're taking the FullName value returned from the FTP server via the component and then turning around to download using that path like /Home/SA-FTP-M/\Home\SA-FTP-M/MyFile.doc .
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted February 27, 2012 11:12 AM

Hello,

I tested this with our server, with version 4.4.2.3 of our component, and didn't see your issue; what FTP server software and version are you connecting to?

Are you able to use any other FTP software with your server, such as FileZilla?
GinaM

From: Madison, WI USA
Posts: 4
Member Since: 02/24/12
posted February 27, 2012 11:24 AM

If I connect with FileZilla, I don't see any subdirectories in that path, just files. Can you tell me what FTP commands are being sent to get that FullName information from the FTP server? The server admins here aren't seeing anything unusual, but maybe we need to be more targeted in our investigation.
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted February 27, 2012 11:57 AM

Hello,

We're just sending the 'ls' command, with the remoteRoot argument. For ListDirectoryTree, the component sends a 'ls' commands for each folder found.

What server software and version are you connecting to?

What is the value of strRemoteDir? If the folder you're trying to get the structure of is not the default login folder, have you tried changing the working directory to it, and getting a list, without specifying remoteRoot (empty string)? Your server may have trouble returning a correct listing when the 'ls' argument is specified.
Nick B (Admin)

From: Utica, NY USA
Posts: 619
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted February 27, 2012 12:01 PM

Do you see the same issue with our included FTP ListView Client?
Reply | PowerTCP FTP for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX