Login  
Search All Forums
Dart Home | PowerTCP Server for ActiveX | Custom Development Reply | PowerTCP Server for ActiveX Topics | Forums   
AuthorForum: PowerTCP Server for ActiveX
Topic: FTP Server relative vs. absolute path
cstyves

From: North Billerica, MA USA
Posts: 1
Member Since: 02/22/05
posted February 22, 2005 4:08 PM

Hello,

I have an FTPServer component in my VB.NET app with all of the default settings. When I Start() the FTPServer with a relative pathname, I get some funny business when trying to use the server, such as DIR returning nothing (not even . or ..), and MKDIR returning a "permission denied". Changing the Start() call to an absolute path fixes this issue.

What do I do if I want to start the server from a relative path?

Thanks,
cstyves
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted February 22, 2005 4:39 PM

You can't. It was not designed to do that. I would write a function that tries to determine the absolute path from a relative path, then once you have determined that, pass it to the FTP server.

Here's a little VB function that will do it:

  Private Function GetAbsolutePath(ByVal RelativePath As String) As String
    Dim CurrentDirectory As String = Environment.CurrentDirectory
    Dim TempDirectory As String = ""
    Try
      ChDir(RelativePath)
      TempDirectory = Environment.CurrentDirectory
      ChDir(CurrentDirectory)
      Return TempDirectory
    Catch
      Return ""
    End Try
  End Function
Reply | PowerTCP Server for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX