Page 1 of 1

Multiple remote host FTP program

PostPosted: Tue Jun 11, 2013 1:26 pm
by David de Argentina
Hi Dave,

I have 6 different FTP Host accounts.
I'm trying to do a FTP program that allow copy Files and entire Folders between hosts.
In fact, all works fine.
As the main program is very difficult to read because the quantity of data i put into the screen, i'm trying to do an external client (a separated program) that does the following:

Code: Select all
StrParse "[CommandLine]" "[#13]" "[arg_]" "[cuantos]"

if "[cuantos]" "<>" "6"
  AlertBox "FTP Client" "Bad number of Arguments"
Else
  fmConnectRemote "Remote[arg_2]" "[arg_3]" "User=[arg_4];Password=[arg_5];Port=[arg_6];Passive=No;Timeout=60000;InitialPath=;LogLimit=0;KeepAlive=0"
  fmSetFileMask "Remote[arg_2]" "*.*"
  fmSetRootDir "Remote[arg_2]" "/"
  fmShowFileBrowser "Remote[arg_2]" "Rectangulo1"
  fmSetFileBrowserProperties "Remote[arg_2]" "RowSelect=No;ShowHiddenFiles=Yes;ShowCheckBoxes=No;ThumbnailHeight=64"
  fmSetHeaderColumnWidths "Remote[arg_2]" "Name=150"
Endif


I call this program, called "Client" with the following action placed on the Connect Button of the ConnectDialog CustomWindow.

Code: Select all
Run "[Pubdir]Client" "[HostNum][#13][Host][#13][Account][#13][Password][#13][Port]" "Normal" "" ""


Note the [HostNum] variable is an autoincrement to compose the Connection ID value.

In fact, each time i create a new connection, the Connection Dialog works fine, an a new instance of the "Client" program is created with a new FTP Site. All fine.

But, when i try to drag a file or a folder to an another "Client" instance ( another FTP host ) I receive a "File not Found" message error.

Are there any way to correct this ?

Thanks in advance,
David de Argentina

PS: I know i can do it using custom windows into the main program. but if i do this, i limite the quantity of remote hosts according the quantity of CustomWindows i create. Using an external program the quantity is unlimited.

Re: Multiple remote host FTP program

PostPosted: Tue Jun 11, 2013 5:03 pm
by Neosoft Support
Dragging remote files between two separate apps won't work because both the sending and receiving connection need to be able to communicate with each other during the transfer. Since the connections are essentially opened by different applications, they can't communicate. The only thing that might work would be to download the files from one server to a temporary file first, then tell the other app to upload the temp file to the second server. That's kind of what FM/FTP does in the background when transferring between two remote connections.

Re: Multiple remote host FTP program

PostPosted: Tue Jun 11, 2013 5:47 pm
by David de Argentina
Thanks Dave,

You wrote:
"The only thing that might work would be to download the files from one server to a temporary file first, then tell the other app to upload the temp file to the second server. That's kind of what FM/FTP does in the background when transferring between two remote connections."

That means the connection between servers is indirect, triangulating with a non-visible local host, isn't it ?

Thanks again,
David de Argentina

Re: Multiple remote host FTP program

PostPosted: Wed Jun 12, 2013 9:37 am
by Neosoft Support
That means the connection between servers is indirect, triangulating with a non-visible local host, isn't it ?


Yes. This method is slower, but works with all types of servers.