Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3k views
in CompleteFTP by (180 points)
We are evaluating CompleteFTP Pro and it seems to do all that we need it to do (so far) ...
Here's what I need, but I can't seem to get it to work using an FTP Script:
On a CompleteFTP Pro external server, a user with sub folders in their home folder --
Home
--User
----Sub1
----Sub2
----Sub3
----Sub4

On an internal server, on a shared network volume with FTP access from CompleteFTP --
Root
--User
----Sub1
----Sub2
----Sub3
----Sub4

I can't get items put into one of the user sub folders to copy into the corresponding sub folder on the internal server. I can get the files copied to multiple sub folders, but not to just the desired sub folder. Folder names are the same on both servers (obviously the paths aren't the same).
How do I get files copied to the correct single sub folder from CompleteFTP?
Is there a way to use a single FTP script that handles all sub folders for each user -- or do I need separate FTP scripts for each sub folder for each user?
Thanks!

4 Answers

0 votes
by (162k points)
What script are you using and how is it initiated?
0 votes
by (180 points)
# Sample FTP script for uploading a file to another server
#
protocol=ftp
remotehost=192.168.0.000
user=user
password=pswd
# connect to the server
open
# change to sub folder
cd User
# upload the file for which the trigger occurred to the server
put "%WindowsPath%" "Sub1\%FileName%"
# disconnect
close

Initiated on "Upload" -- "Trigger on success"
With the path hard-wired for the "put" command (above), separate scripts are needed for each sub folder for each user, but that results in multiple copies of the file on the internal server.
0 votes
by (51.6k points)
I'm sorry we missed your reply. I hope you haven't given up in the meantime. As a trial user you're entitled to e-mail-based support for the duration of your trial. E-mail responses are prioritized ahead of forum posts. You can e-mail us at support@enterprisedt.com

Anyway, I noticed that your put statement uses a backslash rather than a forward slash. That might be the cause of your problem.

- Hans (EnterpriseDT)
0 votes
by (162k points)
OK, I see the problem. I have to admit it's pretty confusing. Our FTP scripting feature is actually executed using an external executable called edtftp.exe, which you'll find in C:\Program Files (x86)\Complete FTP\Server. This means that it "lives" in the Windows file-system rather than the CompleteFTP virtual file-system. In other words, when you're telling it the path of a local file you need to use its Windows path rather than its CompleteFTP path.

This means that you need to do the following:

# change folders
cd "%VirtualPath%"

# upload the file for which the trigger occurred to the server
put "%WindowsPath%" "%FileName%"


The 'cd' refers to the remote server's file system. I understood that it has the same directory structure as the local CompleteFTP server, so I used the local server's virtual path. In the 'put' I referenced the local file using its Windows path for the reason explained above.

I hope that makes sense.

FYI we are actually planning to offer a much more powerful Javascript-based scripting option some time later this year, which will eliminate these problems, as well as offering a far more flexible syntax.

Categories

...