|
3 | 3 | // url like ftp.4D.com or ftp.4d.com:1234 |
4 | 4 | // if you use ftps or sftp, also modify the last parameter (protocol) in .new() below |
5 | 5 | // don't add the protocol to the hostname, don't use https://xxx or ftp://xxx |
6 | | -$credentialspath:=Get 4D folder:C485(Database folder:K5:14) |
7 | | -$folder:=Folder:C1567($credentialspath; fk platform path:K87:2) |
8 | | -$credentialsfile:=$folder.parent.file("credentials.txt").getText() |
9 | | -$credentials:=JSON Parse:C1218($credentialsfile) |
10 | | -If (False:C215) |
11 | | - $credentials.url:="192.168.10.54:3421" |
12 | | - // $credentials.user:="myself" |
13 | | - // $credentials.pass:="notmypass" |
14 | | -End if |
15 | 6 |
|
| 7 | +$test:="S3" |
16 | 8 | var $ftp : cs:C1710.FileTransfer_rclone |
17 | | - |
18 | | -//$ftp:=cs.FileTransfer_rclone.new("ftp_nas") |
19 | | -If (True:C214) |
20 | | - $ftp:=cs:C1710.FileTransfer_rclone.new("Devcon") |
21 | | - $ftp.setPath("/users/thomas/Desktop/rclone-v1.59.1-osx-arm64/rclone") |
22 | | - |
23 | | -Else |
24 | | - $ftp:=cs:C1710.FileTransfer_rclone.new(":ftp") //not a config name, but service name |
25 | | - $ftp.setPath("/users/thomas/Desktop/rclone-v1.59.1-osx-arm64/rclone") |
26 | | - |
27 | | - $pass:=$ftp.obscure($credentials.pass) |
28 | | - $url:=Replace string:C233($credentials.url; ":3421"; "") |
29 | | - $port:="3421" |
30 | | - $ftp.setPrefix("--ftp-host "+$url+" --ftp-port 3421 --ftp-user "+$credentials.user+" --ftp-pass "+$pass) |
31 | | -End if |
| 9 | +$path:="/users/thomas/Desktop/rclone-v1.59.1-osx-arm64/rclone" |
| 10 | + |
| 11 | +Case of |
| 12 | + : ($test="credentials") |
| 13 | + $credentialspath:=Get 4D folder:C485(Database folder:K5:14) |
| 14 | + $folder:=Folder:C1567($credentialspath; fk platform path:K87:2) |
| 15 | + $credentialsfile:=$folder.parent.file("credentials.txt").getText() |
| 16 | + $credentials:=JSON Parse:C1218($credentialsfile) |
| 17 | + If (False:C215) |
| 18 | + $credentials.url:="192.168.10.54:3421" |
| 19 | + // $credentials.user:="myself" |
| 20 | + // $credentials.pass:="notmypass" |
| 21 | + End if |
| 22 | + |
| 23 | + $ftp:=cs:C1710.FileTransfer_rclone.new(":ftp") //not a config name, but service name |
| 24 | + $ftp.setPath($path) |
| 25 | + |
| 26 | + $pass:=$ftp.obscure($credentials.pass) |
| 27 | + $url:=Replace string:C233($credentials.url; ":3421"; "") |
| 28 | + $port:="3421" |
| 29 | + $ftp.setPrefix("--ftp-host "+$url+" --ftp-port 3421 --ftp-user "+$credentials.user+" --ftp-pass "+$pass) |
| 30 | + |
| 31 | + : ($test="ftp") |
| 32 | + //$ftp:=cs.FileTransfer_rclone.new("ftp_nas") |
| 33 | + $ftp:=cs:C1710.FileTransfer_rclone.new("Devcon") |
| 34 | + Else |
| 35 | + $ftp:=cs:C1710.FileTransfer_rclone.new($test) |
| 36 | +End case |
| 37 | +$ftp.setPath($path) |
32 | 38 |
|
33 | 39 | If (False:C215) |
34 | 40 | $result:=$ftp.version() |
|
0 commit comments